GODrums / BetterFloat

Enhance your website experience on CSFloat, Skinport & Skinbid
https://betterfloat.com/
Other
39 stars 10 forks source link

fix: wrong currency format #46

Closed alxcar closed 8 months ago

alxcar commented 8 months ago

Fixed a minor issue that was breaking the extension for currencies such as AED, CHF, DKK, NOK, PLN, and SAB, which was caused by the spaces between their symbols and numbers, instead of them being directly next to each other.

image image

image image

We can easily resolve this and obtain the correct format by eliminating the mentioned space.

const regex = /([A-Za-z]+)\s+(\d+)/;
let priceText = priceContainer?.textContent?.trim().replace(regex, '$1$2').split(/\s/) ?? [];

image

GODrums commented 8 months ago

Great find again! I guess it gets kinda obvious now that I'm straight up lacking the time to test everything when sites introduce new features 😅