fixed-width-float
display a float in a fixed-width string
example
var showf = ;var rows =1 2 250212 987654321-3 -000001234 6212e-20 -5555555-500000 32105e99 -72e5 61e-94 -10 9950255 -996e-50;rows;
output:
1.000 2.000 250.212 9.88e+8
-3.000 -1.23e-5 0.00e+0 -555.556
-5.00e+5 3.21050 -7.20e+5 6.00e-9
4.000 -10.000 9950.25 0.00e+0
methods
var showf =
var s = showf(n, bytes=8)
Return a string s
to display the floating point value n
in so many bytes
.
install
With npm do:
npm install fixed-width-float
This code works in the browser with browserify.
You can download a UMD build from browserify CDN:
http://wzrd.in/standalone/fixed-width-float@latest
license
MIT