diff options
Diffstat (limited to 'src/webex/renderHtml.tsx')
-rw-r--r-- | src/webex/renderHtml.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
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"; @@ -63,6 +65,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 <span>{x} {amount.currency}</span>; +} + + +/** * Abbreviate a string to a given length, and show the full * string on hover as a tooltip. */ |