Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
663 B
1
Indexable
Never
 let activePrice = item?.optimizedPrice?.displayPrice?.formattedValue?.replace('$', '') || null;
        activePrice = activePrice ? activePrice.replace(/\s/g, '') : '';
        let wasPrice = item?.optimizedPrice?.wasprice?.value?.replace('$', '') || null;
        wasPrice = wasPrice ? wasPrice.replace(/\s/g, '') : '';
        if (this.state.lang == 'fr') {
          activePrice = activePrice ? activePrice.replace(',', '.') : '';
          wasPrice = wasPrice ? wasPrice.replace(',', '.') : '';
        } else {
          activePrice = activePrice ? activePrice.replace(',', '') : '';
          wasPrice = wasPrice ? wasPrice.replace(',', '') : '';
        }