Hi I did not realise I could just do that, the issue I am having at present is formating the number out put from for example $1234.567891234566 to $1234.56
coinableS already told you what you should do:
Use number_format()
$value = 1234.7890;
$formattedValue = number_format($value,2);
Then, just use the new variable $formattedValue:
You should take some time to learn PHP, since this is all very basic. A ~30 minutes Youtube video should be enough to get your started.
I have been watching videos and reading tutorials, and taking php examples and altering them.
The issue here is I can not figure this out:
$result = $holding * $price;
$value = 1234.7890;
$formattedValue = number_format($value,2);
echo "$result";
The top and bottom lines are what I am using and they are giving me the correct out put, just the format is too long.
I do not understand where the $value has come from or the numbers 1234.7890.
Should the $value be changed to $result to link up with what i have called it in my bit of code ?
Please understand I am not being lay and have and am learning PHP its just a few things confuse me, and I do appreciate you taking the time to reply.
Thanks
TT
EDIT - figured it out... Thank you for helping
$result = $holding * $price;
$value = $result;
$formattedValue = number_format($value,2);
echo $formattedValue;