Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:55:00+00:00 2026-05-29T09:55:00+00:00

How can I format powershell output for decimal without a comma? I am using

  • 0

How can I format powershell output for decimal without a comma?
I am using ‘{0:N2}’ -f $a but I don’t want the comma for the thousands.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:55:01+00:00Added an answer on May 29, 2026 at 9:55 am

    There are a plethora of different format strings. In your case I would suggest:

    ‘{0:d2}’ -f $a

    A good reference is String Formatting in C#

    Actually here are some examples:

    $a = 124000.4201
    
     '{0:g2}' -f $a
    1.2e+05
    
    '{0:f2}' -f $a
    124000.42
    
    # and since it is using the .net formatter for all this after all
    '{0:00.0000}' -f $a
    124000.4201
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to output data from PowerShell without any column headings.
I can format date with strftime in python, but now I want to show
how string.format() can help to avoid using + in such statement: string statement =
I know that using VIM I can format C++ code just using gg=G Now
Can't think any way but with ksh/perl, so powershell is annoying. Attempting to process
I know I can format strings using the String.Format() method. Is it possible to
When using PowerShell to extract information from TFS, I find that I can get
If I can format a string using string.Format(my {0} template {1} here, 1, 2)
In powershell I can use the Format-Table command to sort everything in my results;
how I can format my database-query in a list view with 2 signs after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.