I have a timespamp from PouchDB/CouchDB with in millis and has decimals for more fine precision like this 1494832547145.4412, a want to use it with the process pid to create the id for the db with pattern TPID to make it easier to parse and use it with new Date(timestamp) I'd like to have timpestamp with a fixed length and I made some test like this
> a = 1494832547145.4412
1494832547145.4412
> a.toFixed()
'1494832547145'
> a.toFixed(4)
'1494832547145.4412'
> b = 1494832547145.441
1494832547145.441
> b.toFixed(4)
'1494832547145.4409'
> c = 1494832547145.44
> c.toFixed(3)
'1494832547145.440'
> c.toFixed(4)
'1494832547145.4399'
> c.toFixed(5)
'1494832547145.43994'
> c.toFixed(6)
'1494832547145.439941'
> c.toFixed(7)
'1494832547145.4399414'
what's going on here? Why it's not padding with 0s?