blob: c41f7faf6c042105f7e621d8b62cc0ebc68397fb (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
 | import { AmountJson, Amounts, AmountString } from "@gnu-taler/taler-util";
import { h, VNode, Fragment } from "preact";
export function Amount({ value }: { value: AmountJson | AmountString }): VNode {
  const aj = Amounts.jsonifyAmount(value);
  const amount = Amounts.stringifyValue(aj, 2);
  return (
    <Fragment>
      {amount} {aj.currency}
    </Fragment>
  );
}
 |