elipsett Posted November 12, 2010 Posted November 12, 2010 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?
fseipel Posted November 12, 2010 Posted November 12, 2010 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.
comment Posted November 12, 2010 Posted November 12, 2010 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.
elipsett Posted November 15, 2010 Author Posted November 15, 2010 This does not seem to work when the US$ amount ends with ".00"
elipsett Posted November 15, 2010 Author Posted November 15, 2010 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now