mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Updated number formatter to use locale method
no refs Updates number formatter to use native `toLocaleString` instead of custom regex
This commit is contained in:
parent
3067456a0e
commit
2e41b24240
@ -192,7 +192,10 @@ export const getCurrencySymbol = (currency) => {
|
||||
};
|
||||
|
||||
export const formatNumber = (amount) => {
|
||||
return amount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
if (amount === undefined || amount === null) {
|
||||
return '';
|
||||
}
|
||||
return amount.toLocaleString();
|
||||
};
|
||||
|
||||
export const createPopupNotification = ({type, status, autoHide, duration, closeable, state, message, meta = {}}) => {
|
||||
|
Loading…
Reference in New Issue
Block a user