diff --git a/public/app.js b/public/app.js index 77da623..18f08d5 100644 --- a/public/app.js +++ b/public/app.js @@ -509,7 +509,12 @@ async function selectTable(schema, tableName) { if (value === null || value === undefined || value === '') return ''; const num = parseFloat(value); if (isNaN(num)) return value; - return num.toLocaleString('ru-RU'); + // Определяем количество знаков после запятой из исходного значения + const decimalPlaces = (String(value).split('.')[1] || '').length; + return new Intl.NumberFormat('ru-RU', { + minimumFractionDigits: 0, + maximumFractionDigits: Math.min(decimalPlaces, 6) + }).format(num); } }), // ✅ Добавляем тултип для заголовка @@ -915,12 +920,12 @@ async function selectTable(schema, tableName) { const newValue = cell.getValue(); // Проверяем, действительно ли значение изменилось - // Учитываем преобразование типов (число vs строка) - const valuesEqual = oldValue === newValue || - (oldValue == null && newValue === '') || - (oldValue === '' && newValue == null) || - (typeof oldValue === 'number' && String(oldValue) === newValue) || - (typeof newValue === 'number' && String(newValue) === oldValue); + // Учитываем преобразование типов и пустые значения + const normalizeValue = (v) => { + if (v === null || v === undefined || v === '') return null; + return String(v); + }; + const valuesEqual = normalizeValue(oldValue) === normalizeValue(newValue); if (valuesEqual) { console.log('⏭️ Значение не изменилось:', cell.getField(), oldValue, '→', newValue);