hcui-package 1.9.70 → 1.9.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/utils.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 处理金额的显示 除以10000 并保留两位小数
|
|
2
|
+
export const handleViewPrice = (value, fixed = 2) => {
|
|
3
|
+
if (!value) return ''
|
|
4
|
+
return Number(value / 10000).toFixed(fixed)
|
|
5
|
+
}
|
|
6
|
+
// 处理金额的提交 乘以10000 并保留两位小数
|
|
7
|
+
export const handleSavePrice = (value, fixed = 2) => {
|
|
8
|
+
if (!value) return ''
|
|
9
|
+
return Number(value * 10000).toFixed(fixed)
|
|
10
|
+
}
|