mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
fbdad78af4
* lazy load compoennts more granularly * add changeset * format * add changeset * fix casing * fix casing * fix casing * revert changelog formatting * add changeset * revert changelog formatting * add changeset * make interactive updates work * revert changelog stuff * fix order * fix static dataframe * revert demo change --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
11 lines
273 B
TypeScript
11 lines
273 B
TypeScript
export function pretty_si(num: number): string {
|
|
let units = ["", "k", "M", "G", "T", "P", "E", "Z"];
|
|
let i = 0;
|
|
while (num > 1000 && i < units.length - 1) {
|
|
num /= 1000;
|
|
i++;
|
|
}
|
|
let unit = units[i];
|
|
return (Number.isInteger(num) ? num : num.toFixed(1)) + unit;
|
|
}
|