Add prepaid subscription management page

This commit is contained in:
2021-11-16 13:58:00 +01:00
parent 35dc1da2fb
commit 7845753b27
7 changed files with 356 additions and 28 deletions

View File

@@ -15,17 +15,17 @@ export const formatThousands = (x) => {
export const formatDataVolume = (amt, precision) => {
if (precision < 3) { precision = 3; }
if (amt >= 1e18) {
if (amt >= 1e18-1e15) {
return (amt/1e18).toPrecision(precision) + " EB";
}else if (amt >= 1e15) {
}else if (amt >= 1e15-1e12) {
return (amt/1e15).toPrecision(precision) + " PB";
}else if (amt >= 1e12) {
}else if (amt >= 1e12-1e9) {
return (amt/1e12).toPrecision(precision) + " TB";
} else if (amt >= 1e9) {
} else if (amt >= 1e9-1e6) {
return (amt/1e9).toPrecision(precision) + " GB";
} else if (amt >= 1e6) {
} else if (amt >= 1e6-1e3) {
return (amt/1e6).toPrecision(precision) + " MB";
} else if (amt >= 1e3) {
} else if (amt >= 1e3-1) {
return (amt/1e3).toPrecision(precision) + " kB";
}
return amt + " B"
@@ -58,4 +58,8 @@ export const formatDate = (date, hours, minutes, seconds) => {
if (seconds) { dateStr += ":"+("00"+date.getMinutes()).slice(-2) }
return dateStr
}
export const formatEuros = (amt, precision) => {
return "€ "+ (amt / 1000000).toFixed(precision)
}
</script>