Comments (10)
Great idea. I even like the way you structured it. I think you said you were going to look at rewriting the unformatting parser. if you want to do that, i will add this feature.
from numeral-js.
Sounds good to me. If you want to tackle it then that's fine — but I have time to work on it too, if you have other stuff you're already working on. Either way, I'll probably wait to re-write the unformatter until this is implemented.
For options, I'm guessing we could just extend the current currency object in the language files with something like this:
{
// part of the language config file
currency: {
symbol: '$',
format: {
'$': '$0.[00]a', // shows $0.25k, $1.5k, $1.55m, etc.
'$$': '$0,0', // shows $100,000; $250,000,000; etc.
'$$$': '$0,0.00', // shows $100,000.00; $99,999.99; etc.
}
}
}
Not sure if that's the best way and not sure on the exact difference between $$ and $$$. Could be something like '$$': '$0'
instead. Thoughts?
(Also, If you want to write the functionality, I can create the formats for every other language.)
from numeral-js.
i like the way you have defined them. i think it is safe to assume that delineated thousands for $$ are usually wanted for readability. looks like you are all over this, so go ahead and make it happen.
from numeral-js.
Haha, yeah... using it on a small project right now that needs to show all kinds of currencies and could use the functionality to make my life easier.
from numeral-js.
Any progress on this?
from numeral-js.
Have it close to being done but client work has gotten in the way. If it looks like I can't get to it in the next couple of days, I'll push what I have to a feature branch on my fork so you can handle it if you prefer to. Sorry for dropping off the face of the earth.
from numeral-js.
No problem. I'm not in any hurry, just liked the idea and wanted to make sure we didn't forget about it.
from numeral-js.
Still working on this. Know it's been a while, but RL has been getting in the way. Let me know if you want to take over the development and I'll publish my progress. Otherwise, I'll try to have it done as soon as possible.
from numeral-js.
How is this going on? Is it already finished and published? I don´t see any documentation talking about it. If it´s published, where can I find it?
from numeral-js.
This can be achieved with formatting.
from numeral-js.
Related Issues (20)
- NumeralJS Should Be Marked as Deprecated or Abandoned HOT 5
- numeral(-0.01775).format('0.0000') => -0.0177 HOT 1
- Value changes when Multiplying with 1 HOT 1
- While entering large number(999999999999990) it is showing wrong output HOT 1
- Format '0,0[.]00 $' works only with Dollar symbol. HOT 1
- number with bracketed note will be treated as negative: 100(a) => -100
- Use numeral () to format percentages, occasionally losing precision
- Use numeral () to convert percentages, occasionally losing precision
- formating a number which is long integer will get NaN, (more than 22 digit.) HOT 3
- GPB issue HOT 1
- locales issue with react HOT 3
- numeraljs.com website information is not displayed completely HOT 1
- reset to en-US HOT 1
- Formatting a negative currency with rounding results in an invalid string HOT 2
- Support BigInt in the operators
- Is there a way to multiply out (undo) exponential notation for floats?
- Strange formatting behavior HOT 1
- is the project still alive? HOT 4
- Error when numeral(999.999).format('0,0.[00] a')
- numeral(0.0).add(numeral(0.000002 * 0.24).value()).value() returns 0 instead of 4.8e-7
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 numeral-js.