round a number

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
bichlepa
Posts: 148
Joined: 04 Mar 2014 18:29
Location: Germany
Contact:

round a number

Post by bichlepa » 19 Mar 2014 08:13

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.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: round a number

Post by Martin » 19 Mar 2014 16:45

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.

Post Reply