feat(hall): 支持按行选择开注商与选号种类并优化下注表格
Some checks failed
lotteryfront CI / build (push) Has been cancelled
Some checks failed
lotteryfront CI / build (push) Has been cancelled
This commit is contained in:
@@ -52,13 +52,12 @@ function formatMinorWithDisplaySettings(
|
||||
return `${negative ? "-" : ""}${integerPartFormatted}${decimalSeparator}${fractionPadded}`;
|
||||
}
|
||||
|
||||
export function formatMinorAsCurrency(
|
||||
export function formatMinorAmount(
|
||||
minor: number | string,
|
||||
currencyCode: string,
|
||||
decimalPlaces?: number,
|
||||
): string {
|
||||
const n = typeof minor === "string" ? Number(minor) : minor;
|
||||
if (!Number.isFinite(n)) return `${currencyCode} —`;
|
||||
if (!Number.isFinite(n)) return "—";
|
||||
|
||||
const format = getCurrencyDisplayFormat();
|
||||
const resolvedDisplayDecimals =
|
||||
@@ -68,10 +67,18 @@ export function formatMinorAsCurrency(
|
||||
? Math.min(12, Math.trunc(decimalPlaces))
|
||||
: format.displayDecimals;
|
||||
|
||||
const amount = formatMinorWithDisplaySettings(n, {
|
||||
return formatMinorWithDisplaySettings(n, {
|
||||
...format,
|
||||
displayDecimals: resolvedDisplayDecimals,
|
||||
});
|
||||
}
|
||||
|
||||
export function formatMinorAsCurrency(
|
||||
minor: number | string,
|
||||
currencyCode: string,
|
||||
decimalPlaces?: number,
|
||||
): string {
|
||||
const amount = formatMinorAmount(minor, decimalPlaces);
|
||||
|
||||
return `${currencyCode} ${amount}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user