Solved

Add A ' %' sign to decimal value

Posted on 2014-03-27
4
211 Views
Last Modified: 2014-11-27
Hi

I'm displaying a decimal value in a label.

I just want to add a % behind the label. I've tried
 + "%"  

Open in new window

but does not work

Code

   
Dim FinalFinalAPR As Decimal = Math.Round(FinalAPR, 1)


        lbAPR.Text = FinalFinalAPR 

Open in new window

 I just want to to display a % behind the lbAPR.text

thanks
0
Comment
Question by:edjones1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Assisted Solution

by:Pasha Kravtsov
Pasha Kravtsov earned 167 total points
ID: 39960404
Dim FinalFinalAPR As Decimal = Math.Round(FinalAPR, 1)
        lbAPR.Text = lbAPR.TEXT.insert(1, "%")

Open in new window

0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 166 total points
ID: 39960437
You probably need to cast the decimal first. Try:
Dim FinalFinalAPR As Decimal = Math.Round(FinalAPR, 1)
lbAPR.Text = FinalFinalAPR.ToString() & "%"

Open in new window

0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 167 total points
ID: 39960439
Hi edjones1,
Whatever value you are adding the percent character to should be converted to string before concatenating the '%' char.
lbAPR.Text = FinalFinalAPR.ToString & "%"

Open in new window

Respectfully yours,
Alan
0
 

Author Closing Comment

by:edjones1
ID: 40468813
Brilliant, Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question