Merge pull request #85 from MD1125/documentation

Improve Documentation, Harden Build Scripts, and Enhance Number Formatting
This commit is contained in:
Face 2025-07-15 18:14:03 +03:00 committed by GitHub
commit e58d343673
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 349 additions and 69 deletions

View file

@ -63,6 +63,8 @@ export function formatPrice(price: number): string {
export function formatValue(value: number | string): string {
const numValue = typeof value === 'string' ? parseFloat(value) : value;
if (typeof numValue !== 'number' || isNaN(numValue)) return '$0.00';
if (numValue >= 1e12) return `$${(numValue / 1e12).toFixed(2)}T`;
if (numValue >= 1e9) return `$${(numValue / 1e9).toFixed(2)}B`;
if (numValue >= 1e6) return `$${(numValue / 1e6).toFixed(2)}M`;
if (numValue >= 1e3) return `$${(numValue / 1e3).toFixed(2)}K`;