Skip to content
pubscout

number_display

3.0.0, released 6 years ago by an unverified publisher

Formats numbers to fit a fixed character length with optional locale separators and units.

WASM-ready
$ flutter pub add number_display
Source repository

What it does

Provides a configurable display function that converts numbers into a compact, length‑limited string, adding units like k, M, G, etc. Handles null, NaN, Infinity and supports locale‑specific separators and rounding options.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to show large numbers in a UI with a strict width constraint
  • You want automatic unit suffixes (k, M, G…) and locale‑aware formatting

Skip it when

  • Precise scientific calculations are required
  • You need advanced charting or visualization of numeric data

Strengths

  • Highly configurable (length, decimal, separator, rounding)
  • Handles edge cases like null, NaN, Infinity gracefully
  • No external dependencies, pure Dart

Weaknesses

  • Limited to number formatting; no charting or UI widgets
  • May throw exceptions for extremely short lengths (<5)

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:number_display/number_display.dart';

final display = createDisplay(length: 8, decimal: 0);
print(display(123456789)); // e.g., 123.46M

Alternatives

Packages that do the same job and could replace number_display.

  • vnlunar

    Convert between Vietnamese Lunar Calendar and Solar calendars.

  • delta_to_html

    Convert Delta format to HTML strings.

  • hex

    Provides simple HEX.encode and HEX.decode functions for converting between byte lists and hexadecimal strings.

  • collection

    Utility functions and classes that extend Dart's collection types and algorithms.