zcash-android-wallet-sdk / cash.z.wallet.sdk.ext / kotlin.Double / convertZecToZatoshi

convertZecToZatoshi

fun Double?.convertZecToZatoshi(decimals: Int = ZEC_FORMATTER.maximumFractionDigits): Long

Format a Double ZEC value as a Long Zatoshi value, by first converting to ZEC with the given precision. Start with ZEC -> End with Zatoshi.

Parameters

decimals - the scale to use for the intermediate BigDecimal.

Return
this Double ZEC value converted into Zatoshi, with proper rounding and precision by leveraging an intermediate BigDecimal object.