Skip to content

Instantly share code, notes, and snippets.

View fliptheweb's full-sized avatar
🎯
Focusing

Artur Kornakov fliptheweb

🎯
Focusing
View GitHub Profile
const Price = (props) => {
const price = props.children.toLocaleString('en', {
style: props.showSymbol ? 'currency' : undefined,
currency: props.showSymbol ? 'USD' : undefined,
maximumFractionDigits: props.showDecimals ? 2 : 0,
});
return <span className={props.className}>{price}</span>
};