$price = 22.5
write-host "The price is $"("{0:N2}" -f ($price))"!"
#NOTE: Prints out-> The price is $ 22.50 ! (Has an EXTRA SPACE after the $ & before the !)
I can do it this long way, but it is too much work: write-host "The price is $" -nonewline write-host ("{0:N2}" -f ($price)) -nonewline write-host "!"
CodePudding user response:
Has an EXTRA SPACE