sh-tools 2.2.12 → 2.2.14
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/package.json +1 -1
- package/packages/utils/other.js +3 -3
package/package.json
CHANGED
package/packages/utils/other.js
CHANGED
|
@@ -178,7 +178,8 @@ export default {
|
|
|
178
178
|
switch (rname) {
|
|
179
179
|
case '$vInput':
|
|
180
180
|
case '$vMoney':
|
|
181
|
-
|
|
181
|
+
let isNumberType = rname === '$vMoney' || ['integer', 'number', 'float'].includes(type)
|
|
182
|
+
if (editable && isNumberType && !$vUtils.isNone(value)) {
|
|
182
183
|
if ($vUtils.isNumber(+max) && +value > +max) {
|
|
183
184
|
value = +max
|
|
184
185
|
} else if ($vUtils.isNumber(+min) && +value < +min) {
|
|
@@ -193,13 +194,12 @@ export default {
|
|
|
193
194
|
} else if (!$vUtils.isNone(value) && ['number', 'float'].includes(type)) {
|
|
194
195
|
rvalue = $vUtils.truncate(value, digits)
|
|
195
196
|
}
|
|
196
|
-
if ($vUtils.isString(rvalue)) rvalue = $vUtils.replaceNutrim(rvalue)
|
|
197
197
|
if (rname === '$vMoney' && !$vUtils.isNone(rvalue)) {
|
|
198
198
|
rtext = $vUtils.truncate($vUtils.divide(rvalue, moneyUnit), digits)
|
|
199
199
|
}else if(rname === '$vInput' && format) {
|
|
200
200
|
rtext = $vUtils.format(format, rowData)
|
|
201
201
|
}
|
|
202
|
-
if (commafy && !bill && bill !== '0') rtext = $vUtils.commafy(rtext, { digits })
|
|
202
|
+
if (commafy && !bill && bill !== '0') rtext = $vUtils.commafy(rtext, { digits }).replace(/0+$/, '').replace(/\.+$/, '')
|
|
203
203
|
break
|
|
204
204
|
case '$vTime':
|
|
205
205
|
format = format ? format.replace('YYYY', 'yyyy').replace('DD', 'dd').replace('hh', 'HH') : defaultDateFormat[type]
|