number_to_chinese 0.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 45

number_to_chinese #

A api to covert number to tradition chinese

Usage #

To use this plugin, add number_to_chinese as a dependency in your pubspec.yaml file.

Example #

import 'package:number_to_chinese/number_to_chinese.dart';

void main() {

  print(NumberToCht().doubleToCht(120.34502)); // 壹佰貳拾元參分肆釐伍毫零貳忽
  print(NumberToCht().doubleToCht(122.3));     // 壹佰貳拾貳元參分
  print(NumberToCht().doubleToCht(12200.3));   // 壹萬貳仟貳佰零伍元參分

  print(NumberToCht().intToCht(103));      // 壹佰零參
  print(NumberToCht().intToCht(1003));     // 壹仟零參
  print(NumberToCht().intToCht(1034));     // 壹仟零參拾肆
  print(NumberToCht().intToCht(10045));    // 壹萬零肆拾伍
  print(NumberToCht().intToCht(12050789)); // 壹仟貳佰零伍萬零柒佰捌拾玖
  print(NumberToCht().intToCht(1234567890123456789));

  //壹佰貳拾參京肆仟伍佰陸拾柒兆捌仟玖佰零壹億貳仟參佰肆拾伍萬陸仟柒佰捌拾玖
}

[0.0.1]

  • Initial release.

example/lib/main.dart

import 'package:number_to_chinese/number_to_chinese.dart';

void main() {

  print(NumberToCht().doubleToCht(120.34502)); // 壹佰貳拾元參分肆釐伍毫零貳忽
  print(NumberToCht().doubleToCht(122.3));     // 壹佰貳拾貳元參分
  print(NumberToCht().doubleToCht(12200.3));   // 壹萬貳仟貳佰零伍元參分

  print(NumberToCht().intToCht(103));      // 壹佰零參
  print(NumberToCht().intToCht(1003));     // 壹仟零參
  print(NumberToCht().intToCht(1034));     // 壹仟零參拾肆
  print(NumberToCht().intToCht(10045));    // 壹萬零肆拾伍
  print(NumberToCht().intToCht(12050789)); // 壹仟貳佰零伍萬零柒佰捌拾玖
  print(NumberToCht().intToCht(1234567890123456789));

  //壹佰貳拾參京肆仟伍佰陸拾柒兆捌仟玖佰零壹億貳仟參佰肆拾伍萬陸仟柒佰捌拾玖
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  number_to_chinese: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:number_to_chinese/number_to_chinese.dart';
  
Version Uploaded Documentation Archive
1.0.0 Dec 19, 2018 Go to the documentation of number_to_chinese 1.0.0 Download number_to_chinese 1.0.0 archive
0.0.1 Dec 19, 2018 Go to the documentation of number_to_chinese 0.0.1 Download number_to_chinese 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
74
Overall:
Weighted score of the above. [more]
45
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/number_to_chinese.dart. (-0.50 points)

Analysis of lib/number_to_chinese.dart reported 1 hint:

line 3 col 8: Unused import: 'dart:math'.

Maintenance suggestions

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
Dev dependencies
flutter_test