Print Page | Close Window

displaying currency in asp

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=13956
Printed Date: 30 March 2026 at 3:03pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: displaying currency in asp
Posted By: Dekieon
Subject: displaying currency in asp
Date Posted: 22 February 2005 at 8:31pm

when i try to display a currency value from my database base is doesn't display correctly.

What happens is, if the the decimal place ends in a 0, it doesn't get displayed. for example...
 
 
$19.99 is displayed on the website as $19.99
$21.80 is displayed as $21.8
$20.00 is displayed as $20
 
I tried setting the decimal places in the database to 2, but it didn't help.
anyone know how i can fix this?



Replies:
Posted By: Phat
Date Posted: 22 February 2005 at 8:42pm
http://www.w3schools.com/vbscript/func_formatcurrency.asp


Posted By: dj air
Date Posted: 23 February 2005 at 6:40am
try FormatNumber(currencyvalue,2)

that wil make the currency value to 2 decimal places.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net