Add satoshisRounded to Bitcoins (#3904)

This commit is contained in:
benthecarman 2021-12-14 17:20:57 -06:00 committed by GitHub
parent 6c67e83d3f
commit d66afe9e43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,6 +152,11 @@ sealed abstract class Bitcoins extends CurrencyUnit {
val sat = underlying * CurrencyUnits.btcToSatoshiScalar
Satoshis(sat.toLongExact)
}
def satoshisRounded: Satoshis = {
val sat = underlying * CurrencyUnits.btcToSatoshiScalar
Satoshis(sat.toLong)
}
}
object Bitcoins extends BaseNumbers[Bitcoins] with Bounded[Bitcoins] {