I am using CCur()
instead of CDbl()
as answered in this question:
vbscript mathematical expression not working
But I want to display amount to decimal places e.g 3 should be 3.00 and 3.555 should be 3.55.
How can I achieve this using CCur() function?
CCur() is a "Convert to Currency" function, not a number formatting function.
Use following functions instead:
FormatNumber(number [,DecimalPlaces [,IncludeLeadingZero [,UseParenthesis [, GroupDigits]]]] )
or
FormatCurrency(Expression[,NumDigAfterDec[,IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
number : The number to format.
DecimalPlaces : Number of digits to display after the decimal point.
IncludeLeadingZero : Include a leading zero for numbers <1 and > -1
UseParenthesis : Show negative numbers in Parentheis (500) = -500
GroupDigits : Group large numbers with commas (or the regional delimiter)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With