Quantcast
Channel: PowerShell, formatting values in another culture - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Porky for PowerShell, formatting values in another culture

$
0
0

If you already have the culture loaded in your environment,

    #>Get-Culture    LCID             Name             DisplayName                                                                                                                                             ----             ----             -----------                                                                                                                                             1031             de-DE            German (Germany)                                                                                                                                        #>Get-UICultureLCID             Name             DisplayName                                                                                                                                             ----             ----             -----------                                                                                                                                             1033             en-US            English (United States) 

it is possible to resolve this problem:

PS Home:> $d=1.23PS Home:> $d1,23

like this:

$d.ToString([cultureinfo]::CurrentUICulture)1.23

Of course you need to keep in mind that if other users run the script with a different locale setting, the results may not turn out as originally intended.

Nevertheless, this solution could come in useful. Have fun!


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>