Round to nearest decimal place

Post your questions and help other users.

Moderator: Martin

Post Reply
jam
Posts: 4
Joined: 06 Aug 2015 13:18

Round to nearest decimal place

Post by jam » 06 Aug 2015 13:35

It seems the current round function only rounds to the nearest integer. I need to round to the nearest (specified number of) decimal places.

I have a Flow that takes a dollar amount from an SMS message and converts it to a number to add to another dollar amount from another SMS. Problem is that when the dollar amount(s) are converted to a number there are about 15 decimal places that appear after decimal (29.29999999999997). Later in the Flow I want to copy this amount to clipboard so I can paste it into an application (money management app) as a dollar amount when the app is launched, but need there to be just 2 decimal places after decimal. Any thoughts? (- and yes, I've already requested a new function to round to the nearest specified decimal place)

Thanks to any ideas!
JAM (I like peanut butter too)

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

Re: Round to nearest decimal place

Post by Martin » 06 Aug 2015 19:32

Hi,

You could use the numberformat pattern to copy the rounded value to the clipboard:
{var,numberformat,0.00}

Regards,
Martin

jam
Posts: 4
Joined: 06 Aug 2015 13:18

Re: Round to nearest decimal place

Post by jam » 06 Aug 2015 20:03

And like that ... the problem is solved! Perfect, thanks a bunch Martin!

Cheers!
JAM (I like peanut butter too)

Post Reply