mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 16:17:13 +01:00
Format long numbers. Updated README.
This commit is contained in:
parent
c6b9682296
commit
b1493dfef8
10 changed files with 77 additions and 26 deletions
|
|
@ -1,12 +1,9 @@
|
|||
import React from 'react';
|
||||
import { useSpring, animated } from 'react-spring';
|
||||
import { formatNumber } from '../../lib/format';
|
||||
import styles from './MetricCard.module.css';
|
||||
|
||||
function defaultFormat(n) {
|
||||
return Number(n).toFixed(0);
|
||||
}
|
||||
|
||||
const MetricCard = ({ value = 0, label, format = defaultFormat }) => {
|
||||
const MetricCard = ({ value = 0, label, format = formatNumber }) => {
|
||||
const props = useSpring({ x: value, from: { x: 0 } });
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue