Giter Site home page Giter Site logo

Comments (10)

adamwdraper avatar adamwdraper commented on June 17, 2024

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.

apapirovski avatar apapirovski commented on June 17, 2024

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.

adamwdraper avatar adamwdraper commented on June 17, 2024

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.

apapirovski avatar apapirovski commented on June 17, 2024

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.

adamwdraper avatar adamwdraper commented on June 17, 2024

Any progress on this?

from numeral-js.

apapirovski avatar apapirovski commented on June 17, 2024

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.

adamwdraper avatar adamwdraper commented on June 17, 2024

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.

apapirovski avatar apapirovski commented on June 17, 2024

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.

JuanCarlosCamara avatar JuanCarlosCamara commented on June 17, 2024

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.

adamwdraper avatar adamwdraper commented on June 17, 2024

This can be achieved with formatting.

from numeral-js.

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.