保留N位小数

str.replace(/(\.\d{4})\d+$/, "$1")
posted @ 2023-12-08 11:12  起风了1573  阅读(32)  评论(0)    收藏  举报