1.4.0 • Published 5 years ago

floatify v1.4.0

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

floatify . Common helper to floatify strings

Build Status Scrutinizer Code Quality Code Coverage

New optional toggle

Since v1.4.0 you have a 2nd optional parameter to prefer decimal separator instead of thousands separators (old standard, new default behaviour. See Issue #8 and test/floatify.js for details)

BC Break

Since v1.3.0 floatify exports as function!

var floatify = require("floatify")
// old: floatify.floatify("123123.245346556")
// new:
floatify("123123.245346556")

Usage

Example

var floatify = require("floatify")
floatify("123123.245346556")
>> 123123.245346556
floatify("123.242,5346556")
>> 123242.5346556
floatify("123,242.5346556")
>> 123242.5346556
floatify("123 242 123.7568")
>> 123242123.7568

for more detailed examples see Mocha Testcases in test/floatify.js

Installation with npm

with npm

npm i floatify

with yarn

yarn add floatify

Clone repo

via ssh

git clone git@github.com:pocketrocket/floatify

via https

git clone https://github.com/pocketrocket/floatify.git

Testing

Basic testing done, use npm test or yarn test

1.4.0

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago