111
This commit is contained in:
15
common/price.js
Normal file
15
common/price.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// 10.00 10.60
|
||||
function convertPrice(str) {
|
||||
if (str == undefined || str == null || str == '')
|
||||
return ''
|
||||
if (str.endsWith('.00')) {
|
||||
return str.substring(0, str.length - 3)
|
||||
} else if (str.endsWith('0') && str.includes('.')) {
|
||||
return str.substring(0, str.length - 1)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
export {
|
||||
convertPrice
|
||||
}
|
||||
Reference in New Issue
Block a user