Any Command to Round to certain amount of Digits?
Posted: Fri May 13, 2022 10:15 am
Just looked through Hollywood Math library, and at least none got in to my eye as making it possible to Round to some certain digits.
like lets say I am making software using Euros, and then I calculate some percentage from the sum, which could result for example 12.3456
Since Euros go only to two digits, I would naturally want to do Round(Eur), only up to two digits, making it become 12.35.
This can of course be done by the following:
But I was wondering if there isnt some command which would let me simply do it like:
Meaning EURsum would be rounded up to 2 digits.
like lets say I am making software using Euros, and then I calculate some percentage from the sum, which could result for example 12.3456
Since Euros go only to two digits, I would naturally want to do Round(Eur), only up to two digits, making it become 12.35.
This can of course be done by the following:
Code: Select all
EURsum = Round(EURsum * 100)
EURsum = EURsum / 100Code: Select all
RoundToDigits(EURsum, 2)