CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Money Wont show up like: 36.00

Print topic Send  topic

Author Message
Ryan Kelley
Posted: 01/03/2002, 6:52 PM

In the bookstore example the price of the books show up as: 36.00 if there is no change after the dollar amount. In all of the databases with the bookstore example the fields show up as 36 but then in the online example is shows up as 36.00

How do i make my bookstore show up with the .00 on the end of a whole dollar amount: I can not figure this out for the life of me.

Please Help
??
Posted: 01/03/2002, 8:43 PM

Place on Modules, global functions

Function NumFormat(iNum,iType,iRnd)
'// use to format numeric fields.
'// valid iTypes are "c" for currency, "n" for numeric, "p" for percent.
'// iRnd is number of decimal places to round to.
'// Example fldAmount = NumFormat(fldAmount,"c",2)
'//
iNum = Cstr(iNum)
iRnd = Cstr(iRnd)

'// Check to see if value passed is a number, if not
'// just return the value.
If IsNumeric(iNum) = false Then
NumFormat = iNum
Exit Function
End If

'// Determine itype and format accordingly.
Select Case Itype
Case "n","N"
NumFormat = FormatNumber(iNum,iRnd)
Case "c","C"
NumFormat = FormatCurrency(iNum,iRnd)
Case "p","P"
NumFormat = FormatPercent(iNUm,iRnd)
Case Else
NumFormat = iNum
End Select

End Function
parsam
Posted: 01/03/2002, 11:30 PM

In before show event of the form use number format function to display the field like you want.

In ASP for example:
fldamount = formatnumber(fldamount,2)
Ryan Kelley
Posted: 01/04/2002, 7:01 AM

I tried the global functions thing, what language is that in. I need PHP
bfieldmom
Posted: 05/19/2002, 7:38 PM

i tried the above but could not get it to work. am i supposed to include EVERYTHING listed above, or should i leave out some lines?
please respond with the EXACT syntax to display currency symbols for my field named "Price" . i need only whole dollars to display.

thank you!

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.