mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Merge pull request #259 from Icinga:fix/properly_format_time_span_string_values
Fix: Missing rounding for time span values We should round time span values converted to string to transform `22,8934057h` to `22,89h` for example
This commit is contained in:
commit
53f75e8252
1 changed files with 4 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ function ConvertFrom-TimeSpan()
|
||||||
return (
|
return (
|
||||||
[string]::Format(
|
[string]::Format(
|
||||||
'{0}d',
|
'{0}d',
|
||||||
$TimeSpan.TotalDays
|
([math]::Round($TimeSpan.TotalDays, 2))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +20,7 @@ function ConvertFrom-TimeSpan()
|
||||||
return (
|
return (
|
||||||
[string]::Format(
|
[string]::Format(
|
||||||
'{0}h',
|
'{0}h',
|
||||||
$TimeSpan.TotalHours
|
([math]::Round($TimeSpan.TotalHours, 2))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ function ConvertFrom-TimeSpan()
|
||||||
return (
|
return (
|
||||||
[string]::Format(
|
[string]::Format(
|
||||||
'{0}m',
|
'{0}m',
|
||||||
$TimeSpan.TotalMinutes
|
([math]::Round($TimeSpan.TotalMinutes, 2))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ function ConvertFrom-TimeSpan()
|
||||||
return (
|
return (
|
||||||
[string]::Format(
|
[string]::Format(
|
||||||
'{0}s',
|
'{0}s',
|
||||||
$TimeSpan.TotalSeconds
|
([math]::Round($TimeSpan.TotalSeconds, 2))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue