Solved

Add A ' %' sign to decimal value

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now