Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
1b2ea7a1
Commit
1b2ea7a1
authored
Apr 01, 2026
by
erio
Browse files
fix(ui): also fix floating point precision in mTokToPerToken
parent
a9e5fc85
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/admin/channel/types.ts
View file @
1b2ea7a1
...
@@ -36,7 +36,7 @@ export function toNullableNumber(val: number | string | null | undefined): numbe
...
@@ -36,7 +36,7 @@ export function toNullableNumber(val: number | string | null | undefined): numbe
/** 前端显示值($/MTok) → 后端存储值(per-token) */
/** 前端显示值($/MTok) → 后端存储值(per-token) */
export
function
mTokToPerToken
(
val
:
number
|
string
|
null
|
undefined
):
number
|
null
{
export
function
mTokToPerToken
(
val
:
number
|
string
|
null
|
undefined
):
number
|
null
{
const
num
=
toNullableNumber
(
val
)
const
num
=
toNullableNumber
(
val
)
return
num
===
null
?
null
:
num
/
MTOK
return
num
===
null
?
null
:
parseFloat
((
num
/
MTOK
).
toPrecision
(
10
))
}
}
/** 后端存储值(per-token) → 前端显示值($/MTok) */
/** 后端存储值(per-token) → 前端显示值($/MTok) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment