Thanks for the replies
I was mistaken (ie. I was altering a method that was not being called
therefore there was no observable change)
The start_price variable is a sql variable in the data base it is decared as
smallmoney, it seems to behave as if double.
These two statements work
price = "$" + Convert.ToDecimal(reader["start_price"]).ToString("0.00")
or
price = Convert.ToDecimal(reader["start_price"]).ToString("C",
NumberFormatInfo.CurrentInfo)
With the second I do not need to put in the dollar sign
I need to do this about 120 - 130 times to fix the code ( I did not write it
originally and am just learning c# as I go)
these methods are on pages a in a folder called modules on pages called
along the lines of S3generalDB.cs
So my next question is can I do something like
price = myprice
and have a method that says
myprice = Convert.ToDecimal(reader["start_price"]).ToString("C",
NumberFormatInfo.CurrentInfo)
if should I put it at the top of the page , and how should I declare it
Sorry if this is too simple but I am really new to .net and C#
Regards
Wayne
"LW Irving" <li*****@coffs.com.au> wrote in message
news:ue**************@TK2MSFTNGP12.phx.gbl...
when I use the snippet below
price = "$" + reader["start_price"].ToString() + " to $" +
reader["end_price"].ToString();
the price is returned with 4 decimal places
I thought I could do; reader["start_price"].ToString("C") to format the
string as currency and do away "$" + from the line
or reader["start_price"].ToString("00.00") to at least specify the decimal
places
but niether work
What am I doing wrong
Regards
Wayne
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003