forked from jappel/leistungsbilanz-ts
Standardize phase type labels
This commit is contained in:
parent
084103bf54
commit
096ba8aa1c
23 changed files with 6117 additions and 52 deletions
|
|
@ -214,9 +214,22 @@ export function formatValue(value: GridValue, key?: CellKey): string {
|
|||
if (typeof value === "number") {
|
||||
return formatNumber(value, getMaximumFractionDigits(key));
|
||||
}
|
||||
if (key === "phaseType") {
|
||||
return formatPhaseTypeLabel(String(value));
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
export function formatPhaseTypeLabel(value: string): string {
|
||||
if (value === "single_phase") {
|
||||
return "1-phasig";
|
||||
}
|
||||
if (value === "three_phase") {
|
||||
return "3-phasig";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
export function parseNumeric(cellKey: CellKey, draft: string): number | undefined {
|
||||
const trimmed = draft.trim();
|
||||
if (trimmed === "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue