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 5180 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I've come up with a kludge to handle this by converting to text and fiddling, but there must be a more elegant way to handle it.

I sell books, and depending on what nation they are sold in, the amount may come with two digits to the right of the decimal (like US$), or not (like Japanese yen). It would be convenient to be able to automatically change the format of the prices on invoices and such based on a simple switch for "yen or dollars." Each book has a specific yen price and a specific dollar price set individually.

Any ideas for a simple way to implement it?

Posted

You can define a calculated field, and set it to

Round ( Amt1; Digits_to_Round_to)

Be sure to uncheck do not replace existing value; this way, it will update value when digits_to_round_to changes.

To automatically fill based on country, and prefix the amount with appropriate currency symbol, the calculated field might read

Case(Country="Japan";"¥" & Round(Yen_Amt,0);Country="US"; "$" & Round(Dollar_Amt,2);"Amt Unknown because country not recognized")

If there are many countries, the logic could instead use a lookup on a related database for currency symbol and digits.

Posted

there must be a more elegant way

There is, but not in version 8.5.

Try something like:


Case ( 

Currency = "US" ;

"$" & Int ( DollarPrice ) & SerialIncrement ( ".00" ; 100 * Mod ( DollarPrice ; 1 ) ) ;

"¥" & YenPrice )

Note that this assumes your prices are already rounded as appropriate for each currency.

Posted

This does not seem to work when the US$ amount ends with ".00"

Posted

This appears to work fine... I have to confess I don't completely understand what you just did, but I'll figure it out.

And it is easily adaptable to multiple currencies!

Thank you!

This topic is 5180 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.