From c88bcce9987d4b5cc8123002485a928ff4191e94 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 4 Jun 2017 17:56:55 +0200 Subject: some UI fixes --- src/webex/renderHtml.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/webex/renderHtml.tsx') diff --git a/src/webex/renderHtml.tsx b/src/webex/renderHtml.tsx index 4dd7baded..51f9019ef 100644 --- a/src/webex/renderHtml.tsx +++ b/src/webex/renderHtml.tsx @@ -27,6 +27,8 @@ import { amountToPretty } from "../helpers"; import * as i18n from "../i18n"; import { + AmountJson, + Amounts, ContractTerms, } from "../types"; @@ -62,6 +64,16 @@ export function renderContractTerms(contractTerms: ContractTerms): JSX.Element { } +/** + * Render amount as HTML, which non-breaking space between + * decimal value and currency. + */ +export function renderAmount(amount: AmountJson) { + const x = amount.value + amount.fraction / Amounts.fractionalBase; + return {x} {amount.currency}; +} + + /** * Abbreviate a string to a given length, and show the full * string on hover as a tooltip. -- cgit v1.2.3