initial commit
This commit is contained in:
12
resources/js/lib/helpers.js
Normal file
12
resources/js/lib/helpers.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export function formatUSD(value) {
|
||||
if (value == null || isNaN(value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: 'USD',
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
}).format(value);
|
||||
}
|
||||
Reference in New Issue
Block a user