• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

C# percent without zeros

c# .net
lblRateTitle.Text = RateTitle.ToString("p1");

I'm displaying a percent sign, but it reads....0.45%. and  0.4% and 3.0%
Is there any way to make it read .45% and .4%  and 3% without the zero?
0
designaire
Asked:
designaire
1 Solution
 
BinuthCommented:
RateTitle.ToString("#.#%")
0
 
jlj1527Commented:
try the following format:
lblRateTitle.Text = RateTitle.ToString("#.0#%")

Hope it works.

jlj
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now