mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
add named constructor that should have been done ages ago
This commit is contained in:
parent
8cc72f3448
commit
cb46c2fa3a
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,10 @@ class Amount {
|
||||||
fractionDigits: 0,
|
fractionDigits: 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Amount.zeroWith({required this.fractionDigits})
|
||||||
|
: assert(fractionDigits >= 0),
|
||||||
|
_value = BigInt.zero;
|
||||||
|
|
||||||
/// truncate decimal value to [fractionDigits] places
|
/// truncate decimal value to [fractionDigits] places
|
||||||
Amount.fromDecimal(Decimal amount, {required this.fractionDigits})
|
Amount.fromDecimal(Decimal amount, {required this.fractionDigits})
|
||||||
: assert(fractionDigits >= 0),
|
: assert(fractionDigits >= 0),
|
||||||
|
|
Loading…
Reference in a new issue