Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Add A ' %' sign to decimal value

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
Ed
Asked:
Ed
3 Solutions
 
Pasha KravtsovCommented:
Dim FinalFinalAPR As Decimal = Math.Round(FinalAPR, 1)
        lbAPR.Text = lbAPR.TEXT.insert(1, "%")

Open in new window

0
 
Carl TawnSystems and Integration DeveloperCommented:
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
 
Alan WarrenCommented:
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
 
EdAuthor Commented:
Brilliant, Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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