Got a question because I've got stack (I am still learning :). I am working on some simple data field app and trying to return string (from "function compute(info)") that consists of:
- time (based on calculated value)
- some other string
I have written such a code for trying:
function compute(info) {
var options = { :seconds => (info.elapsedTime / 1000) };
return Time.Gregorian.duration( options );
}
and it works perfectly fine, e.g. for info.elapsedTime = 5000ms I get "0:05" on both simulator and watch (FR230)
now I wanted to add something to output like some text, e.g. "time 0:05" and tried this:
function compute(info) {
var options = { :seconds => (info.elapsedTime / 1000) };
return "time" + Time.Gregorian.duration( options );
}
but got something like this: "time Obj: 30" instead expected "time x:xx"
I expect this is something with casting but cannot find solution.
Would you please give me a hand?