pretty_num 0.0.2
pretty_num: ^0.0.2 copied to clipboard
A lightweight Dart library to format ugly numbers into clean, readable strings like 1.5M, 1,234,567, or 2.4 MB.
example/pretty_num_example.dart
import 'package:pretty_num/pretty_num.dart';
void main() {
// 1. Компактные числа
print(1500.toCompact()); // Выведет: 1.5K
print(2500000.toCompact()); // Выведет: 2.5M
// 2. Читаемые числа с разделителями
print(123456789.toReadable()); // Выведет: 123 456 789
// 3. Конвертация байтов
print(1048576.toBytes()); // Выведет: 1.0 MB
}