mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Extended digit format with custom symbol
This commit is contained in:
parent
60e7a52986
commit
c27df29aeb
1 changed files with 3 additions and 2 deletions
|
|
@ -2,7 +2,8 @@ function Format-IcingaDigitCount()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
[string]$Value,
|
[string]$Value,
|
||||||
[int]$Digits
|
[int]$Digits,
|
||||||
|
[string]$Symbol = 0
|
||||||
);
|
);
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($Value)) {
|
if ([string]::IsNullOrEmpty($Value)) {
|
||||||
|
|
@ -15,7 +16,7 @@ function Format-IcingaDigitCount()
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($Value.Length -lt $Digits) {
|
while ($Value.Length -lt $Digits) {
|
||||||
$Value = [string]::Format('0{0}', $Value);
|
$Value = [string]::Format('{0}{1}', $Symbol, $Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Value;
|
return $Value;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue