From 305c513c2bcc2b25fe57cf0ed9723781944f9f3f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 22 Nov 2023 15:20:06 -0300 Subject: more cashout ui --- packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx') diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx index a6282c947..e035c7fed 100644 --- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx +++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx @@ -18,6 +18,7 @@ import { AmountJson, AmountString, Amounts, + CurrencySpecification, Logger, PaytoString, TranslatedString, @@ -470,13 +471,12 @@ export function InputAmount( ); } -export function RenderAmount({ value, negative, withColor }: { value: AmountJson, negative?: boolean, withColor?: boolean }): VNode { - const { config } = useBankCoreApiContext() +export function RenderAmount({ value, spec, negative, withColor }: { spec: CurrencySpecification; value: AmountJson, negative?: boolean, withColor?: boolean }): VNode { const neg = !!negative //convert to true or false const str = Amounts.stringifyValue(value) const sep_pos = str.indexOf(FRAC_SEPARATOR) - if (sep_pos !== -1 && str.length - sep_pos - 1 > config.currency_specification.num_fractional_normal_digits) { - const limit = sep_pos + config.currency_specification.num_fractional_normal_digits + 1 + if (sep_pos !== -1 && str.length - sep_pos - 1 > spec.num_fractional_normal_digits) { + const limit = sep_pos + spec.num_fractional_normal_digits + 1 const normal = str.substring(0, limit) const small = str.substring(limit) return -- cgit v1.2.3