bugfixing

This commit is contained in:
MuslemRahimi 2024-12-09 01:35:21 +01:00
parent ae98d98874
commit ab6e7419f3

View File

@ -74,12 +74,12 @@ function convertUnitToValue(input: string | number | string[]) {
if (nonNumericValues.has(lowerInput)) return input;
// Handle percentage values
if (input.endsWith("%")) {
const numericValue = parseFloat(input.slice(0, -1)); // Remove '%' and convert to number
if (input?.endsWith("%")) {
const numericValue = parseFloat(input?.slice(0, -1)); // Remove '%' and convert to number
if (isNaN(numericValue)) {
return input; // Return original input if conversion fails
}
return numericValue / 100; // Convert percentage to a decimal
return numericValue //numericValue / 100; // Convert percentage to a decimal
}
// Handle units (B, M, K)