96
Views
4
Comments
Solved
rounded number
Question

Please help, Any values past the two decimal places of the amount shoud be cut off as opposed to rounded 

Example: 64.98765 should display as 64.98

2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Hi Svitlana

You can use the Trunc() function which will remove the decimals. To get it to leave the first 2 decimals use it like this:

Trunc( [YourDecimal] * 100) / 100


Kind rergards, Eric

2020-11-13 07-48-15
Khuong Truong

Hi Svitlana,

I think you can try this function https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Math#Round

For your example: 

Round(64.987, 2)

Regards,

Khuong

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Khuong,

That will round up/down the decimal rather than truncating it as Svitlana is looking for. Using Trunc() is better in this case

2020-11-13 07-48-15
Khuong Truong

Hi Eric,

Thanks for your correction.

Ahh, my bad, was looking at the title then thought needed a round function.

And yes, your solution should work perfectly.

Regards,

Khuong

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.