move-decimal-point
Move the decimal point of numbers to the right or left, operating on the number as a string. In other words, a lightweight way to perform accurate division/multiplication with powers of 10 without needing a library for arbitrary-precision decimal arithmetic.
Install
npm install move-decimal-point
Use
var move_decimal = ; // Move to the right; // '1234.56'; // '123456'; // '12345600' // Move to the left; // '12.3456'; // '0.123456'; // '0.00123456'
Test
git clone git@github.com:shesek/move-decimal-point.git &&
cd move-decimal-point &&
npm install &&
npm test
License
MIT