From c27df29aeb147041c4e8cdc0f6e94caf1cc11cf4 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 16 Sep 2019 17:53:29 +0200 Subject: [PATCH] Extended digit format with custom symbol --- lib/core/tools/Format-IcingaDigitCount.psm1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/tools/Format-IcingaDigitCount.psm1 b/lib/core/tools/Format-IcingaDigitCount.psm1 index 8e6d012..d1228ec 100644 --- a/lib/core/tools/Format-IcingaDigitCount.psm1 +++ b/lib/core/tools/Format-IcingaDigitCount.psm1 @@ -2,7 +2,8 @@ function Format-IcingaDigitCount() { param( [string]$Value, - [int]$Digits + [int]$Digits, + [string]$Symbol = 0 ); if ([string]::IsNullOrEmpty($Value)) { @@ -15,7 +16,7 @@ function Format-IcingaDigitCount() } while ($Value.Length -lt $Digits) { - $Value = [string]::Format('0{0}', $Value); + $Value = [string]::Format('{0}{1}', $Symbol, $Value); } return $Value;