Search code examples
powershelldecimaldata-conversion

How to convert string to decimal in powershell?


I have a string,

$string = "2,55"

How to convert this string to decimal?


Solution

  • In short -

    [decimal]$string.Replace(",", ".")