Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi all,

I got this incredible calculation from you guys a while ago, to make a text field show numbers with the thousanth separaters. this calc rounds off the decimal. I want it to always show 2 decimals. Can someone help me? I still don't fully understand the calc so I am having trouble changing it.

Thanks

this is the current calc:

Case(Labor_Profit < 0 ; "-")

&

Choose( Abs( Round( Labor_Profit ; 2 )) < 10^9 ;

Right( Abs(Int( Round(Labor_Profit ; 2 ) / 10^9 )) ; 3 ) & "," )

&

Choose( Abs( Round( Labor_Profit ; 2 )) < 10^6 ;

Right( Abs(Int( Round( Labor_Profit ; 2 ) / 10^6 )) ; 3 ) & "," )

&

Choose( Abs( Round( Labor_Profit ; 2 )) < 10^3 ;

Right( Abs(Int( Round( Labor_Profit ; 2 ) / 10^3 )) ; 3 ) & "," )

&

Right( Abs( Int( Round(Labor_Profit ; 2 ))) ; 3 )

&

Let([ M = Mod( Labor_Profit; 1 ); P = Min( 2; Length(Round( M; 2 )) - 1 ) ];

Choose( P <= 0; "." &

Right( 10 ^ P & Abs( Round( Labor_Profit; P ) )

* ( 10 ^ P ) ; P ))

)

Posted

I think you can just eliminate the test for Min() for P, just set it to 2. Use this line instead of the one you have:

Let([ M = Mod( Labor_Profit; 1 ); P = 2];

Posted

P stands for 'precision'. If you want fixed precision of 2, you can replace P with 2, get rid of the M, and simplify to:

...

&

"." & Right ( "00" & Abs ( Round ( Labor_Profit * 100 ; 0 ) ) ; 2 )

This topic is 7010 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.