багфиксы: сборка и число с запятыми на некоторых локалях в вебке
This commit is contained in:
@@ -75,6 +75,18 @@
|
||||
return availableTabs[0]
|
||||
}
|
||||
|
||||
function toLocaleStringWithSpaces(num) {
|
||||
if (typeof num !== 'number') {
|
||||
if (typeof num === 'string') { return num }
|
||||
return String(num);
|
||||
}
|
||||
const numberString = num.toString()
|
||||
const [integerPart, fractionalPart] = numberString.split('.')
|
||||
const spacedIntegerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, " ")
|
||||
if (fractionalPart) { return `${spacedIntegerPart}.${fractionalPart}` }
|
||||
else { return spacedIntegerPart }
|
||||
}
|
||||
|
||||
const app = Vue.createApp({
|
||||
data() {
|
||||
return {
|
||||
@@ -161,7 +173,7 @@
|
||||
result = Math.round(result / step) * step
|
||||
if ('min' in validation) { if (result <= validation['min']) { result = validation['min'] } }
|
||||
if ('max' in validation) { if (result >= validation['max']) { result = validation['max'] } }
|
||||
return result.toLocaleString()
|
||||
return toLocaleStringWithSpaces(result)
|
||||
},
|
||||
|
||||
// ========== include from 'common/all-params-methods.js.j2'
|
||||
|
Reference in New Issue
Block a user