mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
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:
@@ -2489,8 +2489,8 @@ const app = createApp({
|
|||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
const number = Number(num);
|
const number = Number(num);
|
||||||
if (number >= 1000000000) {
|
if (number >= 1000000) {
|
||||||
return Math.floor(number / 1000).toLocaleString() + 'k';
|
return Math.floor(number / 1000000).toLocaleString() + 'M';
|
||||||
}
|
}
|
||||||
return number.toLocaleString();
|
return number.toLocaleString();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user