{"id":1924,"date":"2024-11-10T17:14:43","date_gmt":"2024-11-10T09:14:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1924\/"},"modified":"2024-11-10T17:14:43","modified_gmt":"2024-11-10T09:14:43","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%e8%80%8c%e4%b8%8d%e5%bd%b1%e5%93%8d%e6%95%b4%e6%95%b0%e6%98%be%e7%a4%ba%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1924\/","title":{"rendered":"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u800c\u4e0d\u5f71\u54cd\u6574\u6570\u663e\u793a\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173061614928990.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u800c\u4e0d\u5f71\u54cd\u6574\u6570\u663e\u793a\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u800c\u4e0d\u5f71\u54cd\u6574\u6570\u663e\u793a\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5c0f\u6570\u70b9\u4fdd\u7559\u4f4d\u6570\uff1a\u5de7\u5999\u5904\u7406\u5c0f\u6570\u4e0e\u6574\u6570<\/strong><\/p>\n<p>\u95ee\u9898\u4e2d\u63d0\u5230\uff0c\u5e0c\u671b\u4fdd\u7559\u516d\u4f4d\u5c0f\u6570\uff0c\u4f46\u4f7f\u7528tofixed\u65f6\uff0c\u6574\u6570\u4e5f\u4f1a\u4fdd\u7559\uff0c\u5982\u4f55\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u5462\uff1f<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u501f\u52a9 math.round() \u51fd\u6570\u6765\u5de7\u5999\u5730\u5904\u7406\u8fd9\u4e2a\u95ee\u9898\u3002math.round() \u51fd\u6570\u53ef\u4ee5\u5c06\u6570\u5b57\u56db\u820d\u4e94\u5165\u5230\u6700\u63a5\u8fd1\u7684\u6574\u6570\u3002\u901a\u8fc7\u5bf9\u6570\u5b57\u4e58\u4ee5\u4e00\u4e2a\u9002\u5f53\u7684\u57fa\u6570\uff08\u5982 1000000\uff09\uff0c\u7136\u540e\u9664\u4ee5\u76f8\u540c\u7684\u57fa\u6570\uff0c\u5373\u53ef\u5b9e\u73b0\u6240\u9700\u7684\u5c0f\u6570\u4f4d\u4fdd\u7559\uff1a<\/p>\n<pre>Math.round(num * 1000000) \/ 1000000<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u6ee1\u8db3\u95ee\u9898\u4e2d\u7684\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>\u6574\u6570\u663e\u793a\u6b63\u5e38 (\u4f8b\u5982\uff1a1111.1 \u663e\u793a\u4e3a 1111.1)<\/li>\n<li>\u5c0f\u6570\u4fdd\u7559\u6240\u9700\u4f4d\u6570 (\u4f8b\u5982\uff1a0.0003452 \u663e\u793a\u4e3a 0.000345)<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u5229\u7528 math.round() \u51fd\u6570\u7684\u56db\u820d\u4e94\u5165\u7279\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5c0f\u6570\u548c\u6574\u6570\u7684\u81ea\u52a8\u8f6c\u6362\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u800c\u4e0d\u5f71\u54cd\u6574\u6570\u663e\u793a\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\uff1a\u5de7\u5999\u5904\u7406\u5c0f\u6570\u4e0e\u6574\u6570 \u95ee\u9898\u4e2d\u63d0\u5230\uff0c\u5e0c\u671b\u4fdd\u7559\u516d\u4f4d\u5c0f\u6570\uff0c\u4f46\u4f7f\u7528tofixed\u65f6\uff0c\u6574\u6570\u4e5f\u4f1a\u4fdd\u7559\uff0c\u5982\u4f55\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u5462\uff1f \u6211\u4eec\u53ef\u4ee5\u501f\u52a9 math.round() \u51fd\u6570\u6765\u5de7\u5999\u5730\u5904\u7406\u8fd9\u4e2a\u95ee\u9898\u3002math.round() \u51fd\u6570\u53ef\u4ee5\u5c06\u6570\u5b57\u56db\u820d\u4e94\u5165\u5230\u6700\u63a5\u8fd1\u7684\u6574\u6570\u3002\u901a\u8fc7\u5bf9\u6570\u5b57\u4e58\u4ee5\u4e00\u4e2a\u9002\u5f53\u7684\u57fa\u6570\uff08\u5982 1000000\uff09\uff0c\u7136\u540e\u9664\u4ee5\u76f8\u540c\u7684\u57fa\u6570\uff0c\u5373\u53ef\u5b9e\u73b0\u6240\u9700\u7684\u5c0f\u6570\u4f4d\u4fdd\u7559\uff1a Math.round(num * 1000000) \/ 1000000 \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u6ee1\u8db3\u95ee\u9898\u4e2d\u7684\u8981\u6c42\uff1a \u6574\u6570\u663e\u793a\u6b63\u5e38 (\u4f8b\u5982\uff1a1111.1 \u663e\u793a\u4e3a 1111.1) \u5c0f\u6570\u4fdd\u7559\u6240\u9700\u4f4d\u6570 (\u4f8b\u5982\uff1a0.0003452 \u663e\u793a\u4e3a 0.000345) \u901a\u8fc7\u5229\u7528 math.round() \u51fd\u6570\u7684\u56db\u820d\u4e94\u5165\u7279\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5c0f\u6570\u548c\u6574\u6570\u7684\u81ea\u52a8\u8f6c\u6362\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570\u800c\u4e0d\u5f71\u54cd\u6574\u6570\u663e\u793a\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-1924","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1924","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=1924"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1924\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}