Cable Posted November 24, 2004 Posted November 24, 2004 At Devcon, they showed us a way to reformat the data itself in a field to a different format, not just the display. I can't remember how to do that! I have a number field that has values such as "142" "42.2" "42.25" I want the data to be "142.00", "42.20" and "42.25" (always two decimal places). I'm running into the problem because I need to "set field" the value from that field into a global field that contains other data. I've tried to round, setprecision, and truncate. I even tried checking for the position of the decimal point and adding ".00" for ones without a decimal and "00" for the rest, intending to round or truncate to get back to the two demila places format. It failed and keeps returning a single decimal place for values that the second decimal would be zero. Is there an easy way to do that? The "set field" is the most important part... I don't -have- to reformat the orignal number field if it isn't necessary.
-Queue- Posted November 24, 2004 Posted November 24, 2004 Use this as your Set Field calculation. Let( I = Int(table::num); I & "." & Left( Substitute( table::num - I; "."; "" ) & "00" ; 2 ) )
Recommended Posts
This topic is 7373 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 accountSign in
Already have an account? Sign in here.
Sign In Now