CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 updating a PHP page

Print topic Send  topic

Author Message
simon
Posted: 05/24/2011, 9:07 AM

I'm trying update a bit of PHP code someone else did....

I need to fix an issue ie. decimal formatting

A HTML is built like this

str += "<tr><td style='color:#0066ff'>" + pprice +

And displayed like this

document.getElementById("prcontent").innerHTML = str;

I need to make 'pprice' display with 2 decimal place ie. 56.80 (currently
displaying as 56.8)

I tried replacing + pprice + with this + "number_format(" + pprice + ", 2,
'.', '')"
but not working - its showing the text number_format(....




datadoit
Posted: 05/24/2011, 10:08 AM

See: http://www.w3schools.com/jsref/jsref_tofixed.asp

This is javascript, and there is no number_format() for javascript.

Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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