Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3025 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am using a custom function to format a number into currency format ( two decimals ). 

RoundDecimals(11.0) = 11.00

The problems occurs when I use a variable:

$amount = 11.0

RoundDecimals($amount) = 11.11

Similarly, I get the same error using a string:

RoundDecimals("11.0") = 11.11

 

Is there any tricks to get around this issue ? 

This is the custom function that I used (I replaced the comma for a dot and defaulted second parameter to 2):

https://www.briandunning.com/cf/974

 

Posted (edited)
18 minutes ago, comment said:

You should not copy and paste code from people you don't know and use it without understanding how it works.

Needing to understand how it works would defeat half the value of using someone else's code. Encapsulation is a beautiful thing.

Edited by jbante

This topic is 3025 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.