Fix the formatNumber function

This commit is contained in:
Joseph Garrone 2024-06-10 20:14:14 +02:00
parent 5249e05746
commit 77b488d624

View File

@ -1,4 +1,4 @@
export const formatNumber = (input: string, format: string): string => {
export const formatNumber = (input: string, format: string) => {
if (!input) {
return "";
}
@ -20,7 +20,8 @@ export const formatNumber = (input: string, format: string): string => {
let rawValue = input.replace(/\D+/g, "");
// make sure the value is a number
if (`${parseInt(rawValue)}` !== rawValue) {
// @ts-expect-error: It's Keycloak's code, we trust it.
if (parseInt(rawValue) != rawValue) {
return "";
}