fix(user-center): 防止大额资产金额断行

This commit is contained in:
2026-09-16 17:23:56 +08:00
parent e7ffb44b45
commit 56d1b2a417
9 changed files with 59 additions and 5 deletions
+3 -1
View File
@@ -83,6 +83,8 @@ final class AssetAmount {
if ($this->asset === AssetType::POINTS) {
return number_format_i18n($this->minor);
}
return $this->decimal();
global $wp_locale;
$decimal_point = isset($wp_locale->number_format['decimal_point']) ? $wp_locale->number_format['decimal_point'] : '.';
return number_format_i18n(intdiv($this->minor, 100)) . $decimal_point . sprintf('%02d', $this->minor % 100);
}
}