Ask a Question related to ASP Database, Design and Development.
-
Shawn #1
How to ensure 2 places to right of decimal
How can I make certain that decimal values print out 2
places to the right all the time when displaying them on
a website coming from an Access database. Its defined in
the database as a Number, Single, Auto, should I make it
Number, single, 2? I need it to print out like shown
below.
Ex:
1.5 should print out like this 1.50
2.375 should print out like this 2.37
3 should print out like this 3.00
Thanks and Happy Holidays,
Shawn
Shawn Guest
-
Added decimal places
In my tables my number values look right, but when I use a query to to subtractions, I'm getting slightly wrong numbers. For example, I have begin... -
To 2 decimal places
Folks, I know some of you here are extremely dynamic. I am working with a variable that is declared as a decimal. But I want to convert the... -
Decimal places!
Hi fellow Director users!, I had a countdown timer (75 seconds) for a game, and I wanted to display the time taken to complete it, in a field. ... -
Finding Decimal Places
Does anyone know how to find out the number of decimal places a number has. I need this info so that i can round to 3 decimal places if the number... -
do not cut decimal places
Hi, following problem (oracle8): I want to insert a value with precision (#.##) in a number(10,2) column. It works but the values which end with... -
Ken Schaefer #2
Re: How to ensure 2 places to right of decimal
Are you using ASP? If you are using VBScript in your ASP page, then you can
use the FormatNumber() function
FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit
[,UseParensForNegativeNumbers [,GroupDigits]]]])Arguments
Expression
Required. Expression to be formatted.
NumDigitsAfterDecimal
Optional. Numeric value indicating how many places to the right of the
decimal are displayed. Default value is -1, which indicates that the
computer's regional settings are used.
IncludeLeadingDigit
Optional. Tristate constant that indicates whether or not a leading zero
is displayed for fractional values. See Settings section for values.
UseParensForNegativeNumbers
Optional. Tristate constant that indicates whether or not to place
negative values within parentheses. See Settings section for values.
GroupDigits
Optional. Tristate constant that indicates whether or not numbers are
grouped using the group delimiter specified in the control panel. See
Settings section for values.
Cheers
Ken
"Shawn" <programming@jards.com> wrote in message
news:032801c3c9b8$b96ab750$a501280a@phx.gbl...
: How can I make certain that decimal values print out 2
: places to the right all the time when displaying them on
: a website coming from an Access database. Its defined in
: the database as a Number, Single, Auto, should I make it
: Number, single, 2? I need it to print out like shown
: below.
:
:
: Ex:
:
: 1.5 should print out like this 1.50
:
: 2.375 should print out like this 2.37
:
: 3 should print out like this 3.00
:
: Thanks and Happy Holidays,
:
: Shawn
Ken Schaefer Guest
-
Bullschmidt #3
Re: How to ensure 2 places to right of decimal
And just for reference here are some more VBScript (i.e. ASP) functions
too:
VBScript Functions
[url]http://www.w3schools.com/vbscript/vbscript_ref_functions.asp[/url]
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

