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

Extensions for kotlin.Double

convertZecToZatoshi

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.

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

toUsd

Format a Double USD value as a BigDecimal USD value, right-padded to the given number of fraction digits. Start with USD -> End with USD.

fun Double?.toUsd(decimals: Int = USD_FORMATTER.maximumFractionDigits): BigDecimal

toUsdString

Format a USD value into USD with the given number of digits, represented as a string. Start with USD -> end with USD.

fun Double?.toUsdString(maxDecimals: Int = USD_FORMATTER.maximumFractionDigits, minDecimals: Int = USD_FORMATTER.minimumFractionDigits): String

toZec

Format a Double ZEC value as a BigDecimal ZEC value, right-padded to the given number of fraction digits. Start with ZEC -> End with ZEC.

fun Double?.toZec(decimals: Int = ZEC_FORMATTER.maximumFractionDigits): BigDecimal

toZecString

Format a ZEC value into ZEC with the given number of digits, represented as a string. Start with ZEC -> End with ZEC.

fun Double?.toZecString(maxDecimals: Int = ZEC_FORMATTER.maximumFractionDigits, minDecimals: Int = ZEC_FORMATTER.minimumFractionDigits): String