feat: format numbers >= million with M suffix and remove billion k formatting

- Update formatNumber function to display numbers >= 1 million with 'M' suffix
- Remove previous billion formatting with 'k' suffix
- Example: 2,500,000 displays as '2M' for better readability
- Use Math.floor() to ensure no decimal points in formatted numbers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Gemini Wen
2025-07-27 10:50:39 +08:00
parent 2dbcb9d6f3
commit 5ca568e693

View File

@@ -2489,8 +2489,8 @@ const app = createApp({
formatNumber(num) {
if (num === null || num === undefined) return '0';
const number = Number(num);
if (number >= 1000000000) {
return Math.floor(number / 1000).toLocaleString() + 'k';
if (number >= 1000000) {
return Math.floor(number / 1000000).toLocaleString() + 'M';
}
return number.toLocaleString();
},