mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Gauge/BarGauge: Support decimals for min/max toFloatOrUndefined (#18368)
This commit is contained in:
committed by
Torkel Ödegaard
parent
202c136238
commit
09e7938499
@@ -55,3 +55,11 @@ export function toIntegerOrUndefined(value: string): number | undefined {
|
||||
const v = parseInt(value, 10);
|
||||
return isNaN(v) ? undefined : v;
|
||||
}
|
||||
|
||||
export function toFloatOrUndefined(value: string): number | undefined {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
const v = parseFloat(value);
|
||||
return isNaN(v) ? undefined : v;
|
||||
}
|
||||
|
Reference in New Issue
Block a user