WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Limiting float typing
Categories : PHP Update Picture
Zeev Suraski
Date : Oct 17th 1998
Grade : 1 of 5 (graded 1 times)
Viewed : 2973
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Zeev Suraski
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

> Suppose X = 7394; and you'd like to compute how many megabytes X
>evaluates. You'd probably use X / 1024 which will yield: 7.220703125.
>
> Question is: how can you limit the digits after the period, lets say 3
>digits, so the above answer would be: 7.220 = 7.22.

$M = (float) sprintf("%.2f",$X/1024);

(the float casting is not really necessary).



Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
WebFTP: This tool can be used to access FTP sites from behind any firewall or proxy.
Categories : PHP, FTP
.htpassword manager for apache
Categories : PHP, PHP Classes, Authentication, Apache
Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used.
Categories : HTML and PHP, PHP, Date Time
Using PHP to Delete a directory with all sub directories and files using FTP
Categories : PHP, FTP, Directories, Filesystem
IPhider Obscure Any URL Anonymity connection lores obfuscation corporate survival.
Categories : PHP, Algorithms, Security, URLs
mhash -- Compute hash
Categories : PHP, PHP Functions, mhash
Freshmeat.net XML-RPC - This class is meant to query Freshmeat for information about registered projects.
Categories : PHP, PHP Classes, XML, Web Services
How can I know about what Operating System is running on server from PHP?
Categories : PHP, Global Variables
Blueshoes PHP Application Framework
Categories : PHP, Frameworks, PHP Classes
Validating a URL with preg_match
Categories : PHP, Regexps, Beginner Guides, Data Validation
Simple Email address validation
Categories : Email, PHP, Strings
Auto Prepend Site Configuration with PHP and Apache
Categories : PHP, Apache
This PHP function creates dropdown select lists for time and date that you can change, outputs a 14 char MySQL timestamp in a text field
Categories : PHP, MySQL, Java Script, HTML and PHP
Implementing a Members ONLY area
Categories : PHP, MySQL, Databases, Authentication