Anuviel Posted July 3, 2009 Posted July 3, 2009 (edited) I am having a bit of an issue with the following calc: Filter (GetAsNumber(Truncate (Weight / 16 ; 2)) ; "1234567890.") The field Weight is a text field and the result of the calc is set to text. Note that the same problem occurs even if I switch the field types to number and the calc result to number as well. The calc returns .06 when Weight field contains 1 (transforming ounces to pounds). I want it to return 0.06 -> I can format the field to decimal (if I change the result from Text to Number) and it then shows as 0.06 however on export it still shows as .06 Thanks., Edited July 3, 2009 by Guest transforming pounds to ounces - typed it in opposite
comment Posted July 3, 2009 Posted July 3, 2009 I can format the field to decimal (if I change the result from Text to Number) and it then shows as 0.06 however on export it still shows as .06 During export, you have the option to apply current layout's formatting. Otherwise you could try: Let ( r = Round ( Weight * .0625 ; 2 ) ; Int ( r ) & SerialIncrement ( ".00" ; 100 * Mod ( r ; 1 ) ) )
Anuviel Posted July 4, 2009 Author Posted July 4, 2009 Thanks, implemented it and it works nicely. Could you let me know what exactly SerialIncrement does in the calc? Up to that I pretty much understand it but I get lost when I come to it... Thanks.,
comment Posted July 4, 2009 Posted July 4, 2009 It makes sure there are always 2 decimal places shown - so 8 ounces, for example, return "0.50" instead of "0.5". If you don't need this, you can do simply: Let ( r = Round ( Weight * .0625 ; 2 ) ; Int ( r ) & Mod ( r ; 1 ) )
Recommended Posts
This topic is 5680 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