Handle platform coin units in operations ledger
This commit is contained in:
@@ -19,6 +19,8 @@ function valueText(value) {
|
|||||||
}
|
}
|
||||||
function money(value, currency = 'USD') {
|
function money(value, currency = 'USD') {
|
||||||
if (typeof value !== 'number' || !Number.isFinite(value)) return '待核实';
|
if (typeof value !== 'number' || !Number.isFinite(value)) return '待核实';
|
||||||
|
if (currency === 'BILIBILI_COIN') return `${value} B站硬币`;
|
||||||
|
if (typeof currency !== 'string' || !/^[A-Z]{3}$/.test(currency)) return `${value} ${String(currency)}`;
|
||||||
return new Intl.NumberFormat('zh-CN', { style: 'currency', currency, maximumFractionDigits: 2 }).format(value);
|
return new Intl.NumberFormat('zh-CN', { style: 'currency', currency, maximumFractionDigits: 2 }).format(value);
|
||||||
}
|
}
|
||||||
function dateTime(value) {
|
function dateTime(value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user