PowerTip: Use PowerShell to Display Number Grouping and Control Decimal Places

Doctor Scripto

Summary: Use Windows PowerShell to display number grouping and control the number of displayed decimal places.

Hey, Scripting Guy! Question How can I use Windows PowerShell to group digits and control the number of decimal places in a large number?

Hey, Scripting Guy! Answer Use the Numeric Format Specifier, and specify the number of required decimal places. Here are a few examples:

PS C:\> (1000*1000).tostring("N")


PS C:\> (1000*1000).tostring("N1")


PS C:\> (1000*1000).tostring("N3")