Why not just use data formatting on the inspector's data tab to format the data to have two decimal places?
There are cases where such a calculation is necessary, but I wouldn't use a calculation if formatting the field achieves an acceptable result as it is much simpler.
Let ( [ d = Round ( Self ; 2 ) ; i = Int ( d ) ; f = ( d - i ) * 100 ] ; i & "." & Right ( "0" & f ; 2 ) )
Thank you, that worked!
I don't remember why, but I was not able to get the inspector's data tab to work. The numbers showed up correctly in FileMaker, but when I exported the data, if there were 0's at the end of the number (15.00 turned into 15), they were dropped or something like that.
Yes, that is one reason for using the calculation. The data format option in the inspector is for display purposes only, it does not change the data actually present in the field--which is what is then exported.
Please note that rounding values like this should be done with caution. If the value is used in subsequent calculations that reference the rounded instead of the unrounded value, you could introduce error into your calculated result. In such cases, you may need to have a calculation field with this expression to use for exporting the value while you use the original value for such calculations.
In this case, I am just interested in being able to export the field with the correct number of decimal places.
But, I understand your warning about relying on the field for subsequent calculations.