Solved

Add A ' %' sign to decimal value

Posted on 2014-03-27
4
208 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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