Round
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Round
Hi,
Is there a way when using the Round() function to force it to inlcude the "0's" in its result?
For example.
I have a value that is "212" and I want to to the Round() function to 3 decimal places 3 so I want the value returned at "212.000"
Now, before you ask Yes i konw these are the same value but the reason I want to do this is so the fld I am placing this data in keeps its alignment between each item (Tab Del) consistent.
Note, this is for a reporting application.
Is there a way when using the Round() function to force it to inlcude the "0's" in its result?
For example.
I have a value that is "212" and I want to to the Round() function to 3 decimal places 3 so I want the value returned at "212.000"
Now, before you ask Yes i konw these are the same value but the reason I want to do this is so the fld I am placing this data in keeps its alignment between each item (Tab Del) consistent.
Note, this is for a reporting application.
Re: Round
What those guys said.
This goes back to the earliest days of Hypercard. Read up on the "numberFormat" property, especially the use of zeros and hashmarks to format in the desired way. This takes a little practice. Also, pay attention to the fact that a numeric calculation must oftentimes be performed on a value to force it to display as it was ordered to. This may take the form of:
add 0 to yourRecentlyFormattedString
or the monumental:
multiply yourRecentlyFormattedString by 1
This also takes practice.
Craig Newman
This goes back to the earliest days of Hypercard. Read up on the "numberFormat" property, especially the use of zeros and hashmarks to format in the desired way. This takes a little practice. Also, pay attention to the fact that a numeric calculation must oftentimes be performed on a value to force it to display as it was ordered to. This may take the form of:
add 0 to yourRecentlyFormattedString
or the monumental:
multiply yourRecentlyFormattedString by 1
This also takes practice.
Craig Newman
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: Round
This would also do it:
Cheers,
Dave
Code: Select all
put format("%d.000", round( fff )) into ooo
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: Round
This worked perfect, thanks dave!!!dave_probertGA6e24 wrote:This would also do it:Cheers,Code: Select all
put format("%d.000", round( fff )) into ooo
Dave