Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted (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 by Guest
transforming pounds to ounces - typed it in opposite
Posted

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 ) )

)

Posted

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.,

Posted

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 ) 

) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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