pocketrocket / floatify

Common helper to floatify strings in JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to prefer decimal separator

CvBlixen opened this issue · comments

In our use case, too big numbers cause more frustration / damage than too small, so I would like an option to prefer decimal instead of thousands separators.

The tests for it could look something like this:

  {
    title: 'should optionally prefer decimal separators',
    assertions: [
      {
        input: '123.123',
        options: {preferDecimalSeparators: true},
        expectation: 123.123
      },
      {
        input: '123,123',
        options: {preferDecimalSeparators: true},
        expectation: 123.123
      },
    ]
  },

@CvBlixen back from vaccay - will have a look into this EoW

@CvBlixen please check #9