{"id":1840,"date":"2024-11-10T10:45:02","date_gmt":"2024-11-10T02:45:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1840\/"},"modified":"2024-11-10T10:45:02","modified_gmt":"2024-11-10T02:45:02","slug":"%e5%a6%82%e4%bd%95%e4%bf%9d%e7%95%99%e5%b0%8f%e6%95%b0%e4%bd%8d%e6%95%b0%e5%b9%b6%e8%87%aa%e5%8a%a8%e5%8e%bb%e9%99%a4%e5%b0%8f%e6%95%b0%e5%90%8e%e8%be%b9%e7%9a%84-0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1840\/","title":{"rendered":"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u5e76\u81ea\u52a8\u53bb\u9664\u5c0f\u6570\u540e\u8fb9\u7684 0\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173060197014204.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u5e76\u81ea\u52a8\u53bb\u9664\u5c0f\u6570\u540e\u8fb9\u7684 0\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u5e76\u81ea\u52a8\u53bb\u9664\u5c0f\u6570\u540e\u8fb9\u7684 0\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5c0f\u6570\u70b9\u4fdd\u7559\u4f4d\u6570<\/strong><\/p>\n<p>\u60f3\u8981\u81ea\u52a8\u53bb\u6389\u5c0f\u6570\u540e\u8fb9\u7684 0\uff0c\u540c\u65f6\u4fdd\u6301\u6574\u6570\u6b63\u5e38\u663e\u793a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<p>\u5bf9\u4e8e\u6570\u5b57\u5f62\u5f0f\u4e3a Number\uff081111.1\uff09\u7684\u6570\u5b57\uff0c\u4fdd\u7559\u516d\u4f4d\u5c0f\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528 Math.round(num * 1000000)\/1000000\u3002<\/p>\n<p>\u8be5\u65b9\u6cd5\u7684\u539f\u7406\u662f\uff1a<\/p>\n<ul>\n<li>\u5c06\u6570\u5b57\u4e58\u4ee5 1000000\uff0c\u4f7f\u6570\u5b57\u6269\u5927 1000000 \u500d<\/li>\n<li>\u4f7f\u7528 Math.round() \u51fd\u6570\u5bf9\u6269\u5927\u540e\u7684\u6570\u5b57\u8fdb\u884c\u56db\u820d\u4e94\u5165\u3002\u8fd9\u5c06\u820d\u5165\u5230\u6700\u63a5\u8fd1\u7684\u6574\u6570\u3002<\/li>\n<li>\u5c06\u56db\u820d\u4e94\u5165\u540e\u7684\u6570\u5b57\u9664\u4ee5 1000000\uff0c\u6062\u590d\u5230\u539f\u6765\u7684\u5927\u5c0f\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6574\u6570\u5c06\u6b63\u5e38\u663e\u793a\uff0c\u5c0f\u6570\u5c06\u4fdd\u7559\u6307\u5b9a\u7684\u4f4d\u6570\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u5e76\u81ea\u52a8\u53bb\u9664\u5c0f\u6570\u540e\u8fb9\u7684 0\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u6570\u70b9\u4fdd\u7559\u4f4d\u6570 \u60f3\u8981\u81ea\u52a8\u53bb\u6389\u5c0f\u6570\u540e\u8fb9\u7684 0\uff0c\u540c\u65f6\u4fdd\u6301\u6574\u6570\u6b63\u5e38\u663e\u793a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a \u5bf9\u4e8e\u6570\u5b57\u5f62\u5f0f\u4e3a Number\uff081111.1\uff09\u7684\u6570\u5b57\uff0c\u4fdd\u7559\u516d\u4f4d\u5c0f\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528 Math.round(num * 1000000)\/1000000\u3002 \u8be5\u65b9\u6cd5\u7684\u539f\u7406\u662f\uff1a \u5c06\u6570\u5b57\u4e58\u4ee5 1000000\uff0c\u4f7f\u6570\u5b57\u6269\u5927 1000000 \u500d \u4f7f\u7528 Math.round() \u51fd\u6570\u5bf9\u6269\u5927\u540e\u7684\u6570\u5b57\u8fdb\u884c\u56db\u820d\u4e94\u5165\u3002\u8fd9\u5c06\u820d\u5165\u5230\u6700\u63a5\u8fd1\u7684\u6574\u6570\u3002 \u5c06\u56db\u820d\u4e94\u5165\u540e\u7684\u6570\u5b57\u9664\u4ee5 1000000\uff0c\u6062\u590d\u5230\u539f\u6765\u7684\u5927\u5c0f\u3002 \u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6574\u6570\u5c06\u6b63\u5e38\u663e\u793a\uff0c\u5c0f\u6570\u5c06\u4fdd\u7559\u6307\u5b9a\u7684\u4f4d\u6570\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u5e76\u81ea\u52a8\u53bb\u9664\u5c0f\u6570\u540e\u8fb9\u7684 0\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1840","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1840"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1840\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}