use
Round(number, 2)
HTH
-----Messaggio originale-----
Da: Spam Free [mailto:spam.free@n...]
Inviato: giovedì 21 febbraio 2002 16.47
A: ASP Web HowTo
Oggetto: [asp_web_howto] RE: R: Format
Hi,
I want to go the other way and round a number 2 decimal places
e.g. make 411.25764646 display as 411.26 to places...
ASP doesn't seem to like the format method I use in VB
format (number, "0.00")
Regards
spam.free@n...
----- Original Message -----
From: "Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Wednesday, February 20, 2002 2:32 PM
Subject: [asp_web_howto] RE: R: Format
Another way to do it is :
Number = Right("0000" & Number)
Oleg.
-----Original Message-----
From: Giovanni Salucci [mailto:g.salucci@n...]
Sent: February 20, 2002 5:01 AM
To: ASP Web HowTo
Subject: [asp_web_howto] R: Format
as posted some time ago from ken (?)
here:
add this function to your page
function convert(a)
convert = string(4 -len(a) , "0") + cstr(a)
end function
and then usage is
b = convert(4)
Response.Write b
Giovanni
-----Messaggio originale-----
Da: Andy@a... [mailto:Andy@a...]
Inviato: mercoledì 20 febbraio 2002 9.42
A: ASP Web HowTo
Oggetto: [asp_web_howto] Format
Hi
I have a number returned from a datsbase and I have to display it on a
page with leading zeros. IE if 4 is returned I have to display 0004.
I get type mismatch errors if I use format() and I can't get the leading
zeros with FormatNumber().
I need to do this with ASP because I have to send an email receipt of the
number in the correct format.
Any clues?
Andy Green
$subst('Email.Unsub').
$subst('Email.Unsub').
$subst('Email.Unsub').
$subst('Email.Unsub').