Results 1 to 3 of 3
  1.    #1  
    I just found out about issues with my app in the global market. A German user has complained about problems with monetary conversions.

    I wrote my app using the US $, when I would display dollar amounts I'd use Mojo.Format.FormatCurrency fractionDigits:2. And it would display as such.

    Now, users enter in the dollar amount and I display it on the screen before saving it, and I need to pretty much unformat this number to store it and calculate off of it in SQL Lite. I had written it by using javascript replace method for removing the ('$').

    So US currency would store as "150.75", and I'd run sums and divides off of it.

    Now the Euro, has different variations but would be "150,75 (euro symbol)" euros.

    I can use a regular expression to remove all but decimals, but don't know how to do it to keep the comma.

    Then again, I'm wondering if SQL Lite Sum methods would sum up 150,75 correctly as it does with 150.75.

  2. #2  
    Sounds like you just need to always store the unformatted copy, and only FormatCurrency when you display it. If you need to store it internally as a decimal rather than a comma, you could replace it with a regexp or just a string replace?
    My apps:
    ReWeather - Attractive weather app that reflects current conditions
    Suburbly UK (trial version) - Search for properties to rent, share or buy all over UK.

    Twitter: @joshsharp / @recursivemedia
  3.    #3  
    that's what i ended up doing, storing an unformatted version on the screen in a hidden div, updating both the displayed div and hidden div values and saving the hidden div values.


Posting Permissions