v6.1.1
fixed
수학 연산, 포맷팅 및 분석이 가능한 고정 규모 소수.
11좋아요 9.1만30일 다운로드160Pub 점수
AndroidiOSWebmacOSWindowsLinux
고정 정밀도 숫자의 다트 구현.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
The Fixed package allows you to store and perform math on decimal numbers with a fixed scale (fixed no. of decimal places).
All amounts are stored as BigInts to allow precision math to be performed.
The features of Fixed are:
Fixed is sponsored by OnePub, the Dart private package repository.
OnePubYou can create a Fixed instance from a number sources
var t1 = Fixed.fromNum(1); /// == 1.00
var t2 = Fixed.fromNum(1, decimalDigits: 3); /// == 1.000
var add = t1 + 10;
var multiply = t1 * t2;
var t3 = Fixed.parse("1.23356"); // == 1.23356, decimalDigits: 5
if (t1 == t2) // true
{
print(t1.format('0.##')); // '1.00'
print(t3.format('0.###')); // '1.123'
}
Full documentation can be found here.