fixing wrong number extraction

This commit is contained in:
orangecoding
2025-11-03 20:01:55 +01:00
parent 32c7518454
commit 53d5098cec
3 changed files with 5 additions and 4 deletions

View File

@@ -152,8 +152,9 @@ export const storeListings = (jobId, providerId, listings) => {
*/
function extractNumber(str) {
if (!str) return null;
const match = str.replace(/[.,]/g, '').match(/\d+/);
return match ? +match[0] : null;
const cleaned = str.replace(/\./g, '').replace(',', '.');
const num = parseFloat(cleaned);
return isNaN(num) ? null : num;
}
/**