number_to_text_converter 1.0.5 copy "number_to_text_converter: ^1.0.5" to clipboard
number_to_text_converter: ^1.0.5 copied to clipboard

A library to convert a number to its text representation as per the International or Indian Numbering System

example/example.dart

import 'package:number_to_text_converter/number_to_text_converter.dart';

class NumberToTextConverterExample {
  void convertNumbersWithInternationalNumberingSystem() {
    var converter = NumberToTextConverter.forInternationalNumberingSystem();

    print(converter.convert(1)); //prints 'one'
    print(converter.convert(100)); //prints 'hundred'
    print(converter.convert(10000)); //prints 'ten thousand'
    print(converter.convert(100000)); //prints 'one hundred thousand'
    print(converter.convert(1000000)); //prints 'one million'
    print(converter.convert(10000000)); //prints 'ten million'
    print(converter.convert(100000000)); //prints 'hundred million'
    print(converter.convert(1000000000)); //prints 'one billion'
    print(converter.convert(10000000000)); //prints 'ten billion'
  }

  void convertNumbersWithIndianNumberingSystem() {
    var converter = NumberToTextConverter.forIndianNumberingSystem();

    print(converter.convert(1)); //prints 'one'
    print(converter.convert(100)); //prints 'hundred'
    print(converter.convert(10000)); //prints 'ten thousand'
    print(converter.convert(100000)); //prints 'one lakh'
    print(converter.convert(1000000)); //prints 'ten lakh'
    print(converter.convert(10000000)); //prints 'one crore'
    print(converter.convert(100000000)); //prints 'ten crore'
    print(converter.convert(1000000000)); //prints 'hundred crore'
    print(converter.convert(10000000000)); //prints 'one thousand crore'
  }
}
3
likes
120
pub points
72%
popularity

Publisher

verified publishershoutoutsoftware.com

A library to convert a number to its text representation as per the International or Indian Numbering System

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, intl, pedantic

More

Packages that depend on number_to_text_converter