I have a string that represents a number 2.882.956.766.235.065,23
.
I would like it to convert to 2882956766235065.23
but for string with a shorter length everything is fine, with strings of the same length or longer the part after 16 characters is cut off like this 2882956766235065
I'm working with vue3 and typescript
this is my method
export function convertToNumber(value: number | string) {
return Number(String(value).replaceAll('.', '').replaceAll(',', '.'));
}