Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using C# String.Format "{0:p0}" without the leading space before percentage sign

Tags:

string

c#

Using the expression

String.Format("{0:p0}",0.10) gives 10 % 

How do I get this to return 10% (without the space between 10 and %)?

Culture: en-GB

like image 624
Julius A Avatar asked Jun 03 '11 15:06

Julius A


People also ask

How do I use C on my computer?

It is a bit more cryptic in its style than some other languages, but you get beyond that fairly quickly. C is what is called a compiled language. This means that once you write your C program, you must run it through a C compiler to turn your program into an executable that the computer can run (execute).

What is C language used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

How do I start learning C?

Get started with C. Official C documentation - Might be hard to follow and understand for beginners. Visit official C Programming documentation. Write a lot of C programming code - The only way you can learn programming is by writing a lot of code.

What is C function example?

There are two types of functions in C programming: Library Functions: are the functions which are declared in the C header files such as scanf(), printf(), gets(), puts(), ceil(), floor() etc. User-defined functions: are the functions which are created by the C programmer, so that he/she can use it many times.


1 Answers

String.Format("{0:0%}", 0.10)

like image 99
Chris Walsh Avatar answered Oct 10 '22 18:10

Chris Walsh