how to trim the decimal digits to only one digit 3.58333333333333333333333333333
to become 3.5
i want to show only 3.5 from 3.58333333333333333333333333333 without round
and FYI it might have decimal digits and it might not have
i want the result to be
3.58333333333333333333333333333 = 3.5
3 = 3
1 = 1
1.5 = 1.5
Hi Omar,
You can create a simple function to do this. The formula would be the one below, where Number is the number you want to reduce and DecimalPlaces represent the number of places you want to retain:
The algorithm goes like this:
Kind Regards,João
An even simpler way, if one always wants to truncate after the first decimal, would be to multiply by ten, cast to an integer, then divide by ten:
DecimalToInteger(MyDecimal * 10) / 10
Hi @Omar AbdElhadi ,
Use FormatDecimal() inbuilt function of outsystems.
Regards,
Arun
Hello @Arun Rajput , Your answer does not satisfy the requirements asked by Omar. Take a look at the documentation:
Omar explicitly said, "without rounding".Best regards,
Ana