Fixed.fromInt constructor
Creates Fixed scale decimal from minorUnits
with the given
scale
.
scale
defaults to 2 if not passed.
e.g.
final fixed = Fixed.fromInt(100, scale: 2)
print(fixed) : 1.00
Implementation
Fixed.fromInt(int minorUnits, {this.scale = 2}) {
_checkScale(scale);
// final intrinsicScale = minorUnits.toString().length;
// if (intrinsicScale < scale) {
// this.minorUnits =
// BigInt.from(minorUnits) * BigInt.from(10).pow(scale
// - intrinsicScale);
// } else {
this.minorUnits = BigInt.from(minorUnits);
// }
}