Jump to content

Extract formatted number as text


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

Recommended Posts

I have a number field formatted as a decimal with 2 fixed decimal digits. So if I type 100 into the field, it displays as 100.00

Is there a way to get the displayed value out of that field (100.00 as opposed to the actual field value of 100) to display in a text field? Or, do I have to monkey with the number by adding decimal digits (via a calc) if they weren't manually typed?

Link to comment
Share on other sites

Hi

try this calc:

Int ( number ) &

Case(

number * 100 - Int(number) * 100 = 0;".00";

number * 100 - Int(number) * 100 < 10;".0" &number * 100 - Int(number) * 100;

"." & number * 100 - Int(number) * 100

)

or, the same, but better to look:

Let([

i = Int ( number );

d = Right ( 100 + number * 100 - i * 100 ; 2 )

];

i & "." & d

)

Link to comment
Share on other sites

This topic is 5773 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
 Share

×
×
  • Create New...

Important Information

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