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

toUsd

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

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.

Parameters

decimals - the scale to use for the resulting BigDecimal.

Return
this Double USD value converted into a BigDecimal, with proper rounding and precision.