Page 1 of 1

round a number

Posted: 19 Mar 2014 08:13
by bichlepa
My flow crashes when I use addSeconds(Date d, Number a) and "a" contains a number with a comma (for example 30.2). Is it possible to round a number before to get rid of the comma? I haven`t found a round() function or like that.

Re: round a number

Posted: 19 Mar 2014 16:45
by Martin
That's a bug. Should be fixed in the next update.

As a workaround you can either force a conversion to a number with a multiplication by one:

Code: Select all

a="30.2";
result = addSeconds(triggertime, a * 1);
or by explicitly removing the decimal part:

Code: Select all

a="30.2";
result = addSeconds(triggertime, "{a,numberformat,0}");
I will also add a round-function in the next update.