Tuesday, August 9, 2022

[FIXED] How to convert string to decimal in powershell?

Issue

I have a string,

$string = "2,55"

How to convert this string to decimal?


Solution

In short -

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


Answered By - Vivek Kumar Singh
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.