Help!

Formatting Numbers in Database Results

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming RSS
Next:  Magstripe Cards Reader  
Author Message
RoadKill
External


Since: Feb 03, 2009
Posts: 3



PostPosted: Tue Feb 03, 2009 3:08 pm    Post subject: Formatting Numbers in Database Results
Archived from groups: microsoft>public>frontpage>programming (more info?)

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

We are running V2003.

Thank you
Back to top
Karl E. Peterson
External


Since: Dec 10, 2003
Posts: 10



PostPosted: Tue Feb 03, 2009 3:16 pm    Post subject: Re: Formatting Numbers in Database Results [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
RoadKill
External


Since: Feb 03, 2009
Posts: 3



PostPosted: Tue Feb 03, 2009 3:50 pm    Post subject: Re: Formatting Numbers in Database Results [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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>


"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
>
>
>
Back to top
Karl E. Peterson
External


Since: Dec 10, 2003
Posts: 10



PostPosted: Tue Feb 03, 2009 4:02 pm    Post subject: Re: Formatting Numbers in Database Results [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
RoadKill
External


Since: Feb 03, 2009
Posts: 3



PostPosted: Tue Feb 03, 2009 4:12 pm    Post subject: Re: Formatting Numbers in Database Results [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Cool, that works. I hear ya and am rebuilding it without the Wizard now.

Thanks for the help.


"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
>
>
>
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum