Brian Dunning's FileMaker Custom Functions

convertWeight ( value ; input ; output ; precision ; separator )

Converts input of weight to grams, ounces or pounds

  Be the first to rate this function Log in to vote

Jonni™   Jonni™ - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
convertWeight ( 650 ; 1 ; 5 ; 2 ; 1 )
  Sample output:
1 lbs 6.93 oz

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

An input of weight as grams (1), ounces (2) or pounds (3) will output

1 : grams, will output kg with set precision when output value is above 1000 gr
2 : ounces
3 : pounds
4 : auto_us, outputs anything under 16oz as ounces and as pounds if greater or equal than 16 oz
5 : mixed_us, outputs whole pound units as pounds with remaining weight trailing as ounces

Set precision parameter to indicate number of decimals in the returned response. The function will only return decimals for ounces when using mixed_us output format.

Separator:

1 : Inserts a tab character to separate values and legends
2 : Inserts carriage return to separate values and legends
# : Set any text in quotes to add as separator ( " " : for space)

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: