mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
23 lines
437 B
PowerShell
23 lines
437 B
PowerShell
function Format-IcingaDigitCount()
|
|
{
|
|
param(
|
|
[string]$Value,
|
|
[int]$Digits,
|
|
[string]$Symbol = 0
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($Value)) {
|
|
return $Value;
|
|
}
|
|
|
|
$CurrentLength = $Value.Length;
|
|
if ($CurrentLength -ge $Digits) {
|
|
return $Value;
|
|
}
|
|
|
|
while ($Value.Length -lt $Digits) {
|
|
$Value = [string]::Format('{0}{1}', $Symbol, $Value);
|
|
}
|
|
|
|
return $Value;
|
|
}
|