adding 2 decimal places to Convert.ToString

Cory

I am wanting my label to show what the total price of a product is after discount. My label does show the total price after the discount but I can't figure out how to add 2 decimal places to the final price. For example if the total price after a discount is $90 I would like my label to show $90.00. I can only figure out how to display the price without decimals.

lblTotalPrice.Text = "$" + Convert.ToString(totalPrice);
Sajeetharan
lblTotalPrice.Text = "$" + totalPrice.ToString("0.##");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Round a double to 2 decimal places

From Dev

Format decimal value to currency with 2 decimal places

From Dev

Rounding to 2 decimal places in SQL

From Dev

How can I convert to 2 decimal places on inputs?

From Dev

How to convert a Rect ToString, while limiting decimal places?

From Dev

Highchart axis 2 decimal places

From Dev

Convert a number to a String with exactly 2 decimal places

From Dev

Convert a double to 2 decimal places with comma separator

From Dev

Why does this decimal show 8 decimal places on ToString()?

From Dev

How to convert string to decimal with 3 decimal places?

From Dev

Convert string to decimal to always have 2 decimal places

From Dev

2 decimal places inputmask

From Dev

How to convert a double to a string with 2 decimal places?

From Dev

Preventing rounding to 2 decimal places

From Dev

Get NSDecimalNumber with 2 decimal places

From Dev

Convert float and maintain decimal places

From Dev

How to print in 2 decimal places?

From Dev

How to Convert a parseFloat string number to a floating point with 2 decimal places

From Dev

How to convert a Rect ToString, while limiting decimal places?

From Dev

Bcmath adding decimal places randomly

From Dev

Convert a double to 2 decimal places with comma separator

From Dev

Why does this decimal show 8 decimal places on ToString()?

From Dev

Convert from 4 decimal places to 2

From Dev

Display decimal 2 places if float, and display decimal 0 places if int

From Dev

Converting Double to 2 Decimal Places

From Dev

Convert string to decimal to always have 2 decimal places

From Dev

Converting data into 2 decimal places

From Dev

Get NSDecimalNumber with 2 decimal places

From Dev

Formatting with 2 decimal places (NSDecimalNumber)

Related Related

  1. 1

    Round a double to 2 decimal places

  2. 2

    Format decimal value to currency with 2 decimal places

  3. 3

    Rounding to 2 decimal places in SQL

  4. 4

    How can I convert to 2 decimal places on inputs?

  5. 5

    How to convert a Rect ToString, while limiting decimal places?

  6. 6

    Highchart axis 2 decimal places

  7. 7

    Convert a number to a String with exactly 2 decimal places

  8. 8

    Convert a double to 2 decimal places with comma separator

  9. 9

    Why does this decimal show 8 decimal places on ToString()?

  10. 10

    How to convert string to decimal with 3 decimal places?

  11. 11

    Convert string to decimal to always have 2 decimal places

  12. 12

    2 decimal places inputmask

  13. 13

    How to convert a double to a string with 2 decimal places?

  14. 14

    Preventing rounding to 2 decimal places

  15. 15

    Get NSDecimalNumber with 2 decimal places

  16. 16

    Convert float and maintain decimal places

  17. 17

    How to print in 2 decimal places?

  18. 18

    How to Convert a parseFloat string number to a floating point with 2 decimal places

  19. 19

    How to convert a Rect ToString, while limiting decimal places?

  20. 20

    Bcmath adding decimal places randomly

  21. 21

    Convert a double to 2 decimal places with comma separator

  22. 22

    Why does this decimal show 8 decimal places on ToString()?

  23. 23

    Convert from 4 decimal places to 2

  24. 24

    Display decimal 2 places if float, and display decimal 0 places if int

  25. 25

    Converting Double to 2 Decimal Places

  26. 26

    Convert string to decimal to always have 2 decimal places

  27. 27

    Converting data into 2 decimal places

  28. 28

    Get NSDecimalNumber with 2 decimal places

  29. 29

    Formatting with 2 decimal places (NSDecimalNumber)

HotTag

Archive