багфиксы: сборка и число с запятыми на некоторых локалях в вебке

This commit is contained in:
2025-04-01 17:47:08 +03:00
parent 1b6b8b5329
commit 17110a82e0
5 changed files with 43 additions and 16 deletions

View File

@@ -290,6 +290,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 {
@@ -446,7 +458,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'