Formatting a Currency label

Results 1 to 2 of 2

Thread: Formatting a Currency label

  1. #1
    Join Date
    Dec 1969

    Default Formatting a Currency label

    &nbsp;<BR>Hi guys! Its been a while so please bear with me whilst I get back up to speed on<BR><BR>I&#039;m using <BR><BR>lblPrice.Text = objReader("Price")<BR><BR>in code-behind to display the price of an item, but its coming out as 79.950000, even though its held as a currency in SQL Server.<BR><BR>Is it possible to format the value as I assign it to the label?<BR><BR>Cheers!<BR><BR>Dave <BR>

  2. #2

    Default RE: Formatting a Currency label

    In C#... I don&#039;t know how to cast in Basic<BR>Cast the value as a Decimal or other numeric type then ToString with "c" for currency.<BR><BR>lblPrice.Text = ((decimal)objReader["Price"]).ToString("C")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts