diff --git a/src/components/modal/v2/parts/OfferAccordion.jsx b/src/components/modal/v2/parts/OfferAccordion.jsx index 3b88bc820d..100da89f73 100644 --- a/src/components/modal/v2/parts/OfferAccordion.jsx +++ b/src/components/modal/v2/parts/OfferAccordion.jsx @@ -1,6 +1,7 @@ /** @jsx h */ import { h } from 'preact'; import { useEffect, useState } from 'preact/hooks'; +import { delocalize, localize } from '../lib'; import Icon from './Icon'; const OfferAccordion = ({ @@ -16,7 +17,18 @@ const OfferAccordion = ({ const [open, setOpen] = useState(''); const { termsLabel } = content; const currencySymbolFormat = str => { - return str.replace(/(\s?EUR)/g, ' €'); + let result = str?.replace(/(\s?EUR)/g, ' €') ?? ''; + if (offerCountry === 'AT' && result) { + // Reformat the numeric part using the locale's number style so the thousands separator + // matches what the calculator input field displays (de-AT number format uses narrow + // no-break space, whereas de-AT currency format uses period). + const withoutSymbol = result.replace(/\s*€/, '').trim(); + const numericValue = parseFloat(delocalize(withoutSymbol, offerCountry)); + if (!Number.isNaN(numericValue)) { + result = `${localize(numericValue, offerCountry, 2)} €`; + } + } + return result; }; useEffect(() => {