javascript - JSON stringify conversion of float to int -
i using node.js , built-in json object stringify json object. in object is
{ weight : 1.0 }
however when stringify , write file output weight : 1.
actually yours not issue , 1 == 1.0 == 1.00
in javascript , if have float value 1.55
stringify gives same 1.55 not 1
.. if want 1.0
written , change value string
i mean enclose value in double quotes
{ weight : "1.0" }
Comments
Post a Comment