Hello! I don't know if this is an error, but it used to work differently before. If you specify the radix as "," and value with dot like "12.34" the value is converted incorrectly. The problem appeared in 6.5.0 (everything was fine in 6.4.3)
import IMask from 'imask';
const props = {
mask: Number,
scale: 2,
thousandsSeparator: '',
padFractionalZeros: false,
normalizeZeros: true,
radix: ',', // <<<--- Error here! If you specify the radix as ".", there will be no problems.
mapToRadix: ['.', ','],
};
const pipe = IMask.createPipe(props);
const pre = '12.34';
console.log(`${pre} ->> ${pipe(pre)}`); // Output: "12.34 ->> 1234" but is was "12.34 ->> 12,34" before
Hello! I don't know if this is an error, but it used to work differently before. If you specify the radix as "," and value with dot like "12.34" the value is converted incorrectly. The problem appeared in 6.5.0 (everything was fine in 6.4.3)
Online playground https://stackblitz.com/edit/vitejs-vite-k5wm3i?file=main.js