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 116345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:09:48+00:00 2026-05-11T03:09:48+00:00

The Back Story I have some decimal values which I am displaying as strings

  • 0

The Back Story

I have some decimal values which I am displaying as strings on a web page as part of a larger string. I started off using a Standard Numeric Format String to output this. E.g.

myDecimal.ToString('P0') 

The 0 after the P tells it I want no decimal places. This works as far as it goes, in that my ouput ends up looking something like:

Calculated as above based on the phased minimum Company contribution rate of 2 %

The Space Problem

I really want to get rid of that space between the number and the percentage sign as in some cases it ends up splitting across lines. And also, I prefer the % to butt up to the number.

Possible Workarounds

1. html / css solution

I could put a <nobr> tag or a <span style='white-space: nowrap;'> around it. But, that feels awkward, and anyway I prefer the % to butt right up to the number as I think it looks better. It’s how we would write it in reports in this neck of the woods, so it’s how I want it on the web page.

2. Custom format string

I am going to end up using a Custom Numeric Format String, E.g.

myDecimal.ToString('0%') 

The Question

Is it more common to display percentages with a space between the number and the percentage sign? This would surprise me, but it could be.

Is there a way to tell the Standard Numeric Format String I don’t want the space?

Is there any disadvantage to using a Custom Numeric Format String over a Standard Numeric Format String?

Ok – I admit it, that was more than one question – Extra Credit if you answer them all.

  • 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. 2026-05-11T03:09:48+00:00Added an answer on May 11, 2026 at 3:09 am

    Looking at http://www.nasdaq.com/ or http://finance.yahoo.com/ it seems that the percentage sign right after the number with no space inbetween is common 🙂

    Have a look at http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.percentpositivepattern.aspx

    It probably depends on culture, the default (invariant) beeing n %

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

back story: I am designing a portfolio website for myself. on its home page,
Based on this tutorial I have built a page which functions correctly. I added
Back in the old days, Help was not trivial but possible: generate some funky
Ok so the story is my users need a multi-select dropdownlist, which doesn't exist
I'm a novice developer, some experience with rails but still have a lot to
Backstory: I have a PKCS#12 (p12) certificate with a symmetric cipher (password) that I
One of my hobby applications uses a SQLite back end to store the application
Back in VB6, I wrote a few functions that would let me code without
Back in the days of Unix, you couldn't even close a software without reading
I am using a multiline text box in C# to just log some trace

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.