Comments (6)
@rochapablo did you have any luck solving this? I'm having the same issue.
from handlebars-intl.
@gregholland, nop. I kind give up for now. I'm working in other areas and I'll let this for later.
from handlebars-intl.
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.
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.
I was able to solve the problem using singular 'locale' form:
{{formatNumber price style="currency" currency="USD" locale="en-US"}}
from handlebars-intl.
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)
- bower package HOT 4
- How to change value after load ? HOT 2
- Issue with a plural in 'ru' locale HOT 1
- Support for padding currency values HOT 1
- intlGet: Print message path if it is undefined HOT 1
- Currency formatting incorrect when no 'cents' in value. HOT 1
- Invalid date
- How to capitalize month
- Dates interval with format long: do non repeat year
- handlebarsIntl is undefined
- Deprecate old NPM package HOT 4
- Using `formatMessage` in a loop construct
- formatNumber: only a number is accepted
- Currency style does not ensure trailing decimal digits HOT 1
- TypeError: Cannot read property 'escapeExpression' of undefined
- Express Handlebars support HOT 1
- Setting the locale of Handlebars Intl using Express HOT 4
- Noot noot
- Missing Variables Raise an Error and Cause the Entire Template to Fail to Render
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handlebars-intl.