Click here to Skip to main content
15,915,800 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to send a float number as a function parameter in php.
For example I have the following function:
function my_function($my_float = 0.001) {
    
    print_r($my_float);

}

When print_r is executed I get the value of 100 not 0.001.

Why is this happening and how can I keep the value unchanged?

Thank you,
Radu-Stefan
Posted
Updated 17-Jun-13 21:01pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900