|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Formatting Numbers in Database ResultsOkay, so I have several averages that are being displayed in my results page.
How can I get it formatted to two decimal places instead of the 14 that it presently has? 4.78 looks a lot cleaner than 4.77777777777778 We are running V2003. Thank you RoadKill wrote:
> Okay, so I have several averages that are being displayed in my results page. What are you using to read from the database?> How can I get it formatted to two decimal places instead of the 14 that it > presently has? > > 4.78 looks a lot cleaner than 4.77777777777778 If ASP/VBS, use FormatNumber(TheValue, 2). http://www.w3schools.com/vbScript/func_formatnumber.asp It is ASP via the Wizard. Here is one of the averages:
<td align="center"> <!--webbot bot="DatabaseResultColumn" s-columnnames="Coach,AvgOfQuestionOne,AvgOfQuestionTwo,AvgOfQuestionThree,AvgOfQuestionFour,AvgOfQuestionFive,AvgOfQuestionSix,AvgOfQuestionSeven,AvgOfQuestionEight,CountOfID" s-column="AvgOfQuestionSeven" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>AvgOfQuestionSeven<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"AvgOfQuestionSeven")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="59161" --></td> Show quoteHide quote "Karl E. Peterson" wrote: > RoadKill wrote: > > Okay, so I have several averages that are being displayed in my results page. > > How can I get it formatted to two decimal places instead of the 14 that it > > presently has? > > > > 4.78 looks a lot cleaner than 4.77777777777778 > > What are you using to read from the database? > > If ASP/VBS, use FormatNumber(TheValue, 2). > > http://www.w3schools.com/vbScript/func_formatnumber.asp > -- > ..NET: It's About Trust! > http://vfred.mvps.org > > > RoadKill wrote:
> It is ASP via the Wizard. Here is one of the averages: Gonna have to shift into manual at some point, unless you're happy with being Wizzed > > <td align="center"> > <!--webbot bot="DatabaseResultColumn" > s-columnnames="Coach,AvgOfQuestionOne,AvgOfQuestionTwo,AvgOfQuestionThree,AvgOfQuestionFour,AvgOfQuestionFive,AvgOfQuestionSix,AvgOfQuestionSeven,AvgOfQuestionEight,CountOfID" > s-column="AvgOfQuestionSeven" b-tableformat="TRUE" b-hashtml="FALSE" > b-makelink="FALSE" clientside b-MenuFormat preview="<font > size="-1"><<</font>AvgOfQuestionSeven<font size="-1">>></font>" > startspan --><%=FP_FieldVal(fp_rs,"AvgOfQuestionSeven")%><!--webbot > bot="DatabaseResultColumn" endspan i-checksum="59161" --></td> upon. <%=FormatNumber(FP_FieldVal(fp_rs,"AvgOfQuestionSeven"), 2)%> Show quoteHide quote > "Karl E. Peterson" wrote: >> RoadKill wrote: >> > Okay, so I have several averages that are being displayed in my results page. >> > How can I get it formatted to two decimal places instead of the 14 that it >> > presently has? >> > >> > 4.78 looks a lot cleaner than 4.77777777777778 >> >> What are you using to read from the database? >> >> If ASP/VBS, use FormatNumber(TheValue, 2). >> >> http://www.w3schools.com/vbScript/func_formatnumber.asp >> -- >> ..NET: It's About Trust! >> http://vfred.mvps.org Cool, that works. I hear ya and am rebuilding it without the Wizard now.
Thanks for the help. Show quoteHide quote "Karl E. Peterson" wrote: > RoadKill wrote: > > It is ASP via the Wizard. Here is one of the averages: > > > > <td align="center"> > > <!--webbot bot="DatabaseResultColumn" > > s-columnnames="Coach,AvgOfQuestionOne,AvgOfQuestionTwo,AvgOfQuestionThree,AvgOfQuestionFour,AvgOfQuestionFive,AvgOfQuestionSix,AvgOfQuestionSeven,AvgOfQuestionEight,CountOfID" > > s-column="AvgOfQuestionSeven" b-tableformat="TRUE" b-hashtml="FALSE" > > b-makelink="FALSE" clientside b-MenuFormat preview="<font > > size="-1"><<</font>AvgOfQuestionSeven<font size="-1">>></font>" > > startspan --><%=FP_FieldVal(fp_rs,"AvgOfQuestionSeven")%><!--webbot > > bot="DatabaseResultColumn" endspan i-checksum="59161" --></td> > > Gonna have to shift into manual at some point, unless you're happy with being Wizzed > upon. > > <%=FormatNumber(FP_FieldVal(fp_rs,"AvgOfQuestionSeven"), 2)%> > > -- > ..NET: It's About Trust! > http://vfred.mvps.org > > > > > "Karl E. Peterson" wrote: > >> RoadKill wrote: > >> > Okay, so I have several averages that are being displayed in my results page. > >> > How can I get it formatted to two decimal places instead of the 14 that it > >> > presently has? > >> > > >> > 4.78 looks a lot cleaner than 4.77777777777778 > >> > >> What are you using to read from the database? > >> > >> If ASP/VBS, use FormatNumber(TheValue, 2). > >> > >> http://www.w3schools.com/vbScript/func_formatnumber.asp > >> -- > >> ..NET: It's About Trust! > >> http://vfred.mvps.org > > > >
Other interesting topics
Hit Counter not Working
Okay, what now?? Cannot publish DBRW link to frontpage form Painfully slow processing forms in FRONTPAGE Really screwy password problem how do i set up a film strip in Frontpage? Publishing question Can FTP but cannot publish -- do I need the FP extensions?? cgo-bin question Making One Field Required Based on Previous |
|||||||||||||||||||||||