Code Monkey home page Code Monkey logo

Comments (6)

gregholland avatar gregholland commented on May 23, 2024

@rochapablo did you have any luck solving this? I'm having the same issue.

from handlebars-intl.

rochapablo avatar rochapablo commented on May 23, 2024

@gregholland, nop. I kind give up for now. I'm working in other areas and I'll let this for later.

from handlebars-intl.

paulfalgout avatar paulfalgout commented on May 23, 2024

Honestly I don't think this issue has to do with this lib. Under the hood it uses the browsers intl API which is what is using US$ instead of $. So likely in testing this is the browser using a different locale than en-US. You can see in the polyfill what I mean: https://github.com/andyearnshaw/Intl.js/search?p=19&q=%22US%24%22&type=&utf8=%E2%9C%93

from handlebars-intl.

paulfalgout avatar paulfalgout commented on May 23, 2024

Oh and the formats part of the intl file is mostly for shorthand.. so instead of typing {{formatNumber fooNum style="currency" currency="USD"}} with a format you can just do {{formatNumber fooNum "bar"}} where

var intlData = {
    "locales": "en-US",
    "formats": {
        "number": {
            "bar": {
                "style": "currency",
                "currency": "USD"
            }
        }
    }
};

I honestly can't find good reason to use them.. seems hard to maintain.

from handlebars-intl.

azhiv avatar azhiv commented on May 23, 2024

I was able to solve the problem using singular 'locale' form:
{{formatNumber price style="currency" currency="USD" locale="en-US"}}

from handlebars-intl.

Pooja-N-Swamy avatar Pooja-N-Swamy commented on May 23, 2024

Need to use currencyDisplay: 'narrowSymbol' to display $ instead of US$ . Please refer https://stackoverflow.com/questions/52410407/intl-numberformat-currency-us-currency-symbol

from handlebars-intl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.