Hi, I want to chenge the following statement so that numbers ending
with “.00” are changed to blank. Many opinions but I haven’t got any
to work. Any help?
[php]
Hi, I want to chenge the following statement so that numbers ending
with “.00” are changed to blank. Many opinions but I haven’t got any
to work. Any help?
[php]
[php]echo ‘
[member=32030]lothop[/member], That is wrong. There is no such function english_format_number in php
Kevin, son, u care to offer info? Correcting another is of no use to me, maybe him. I wouldn’t ask
b4 trying to resolve . ?
[php]<?php
$row[‘value1’]=125.00;
echo floatval($row[‘value1’]);
?>[/php]
Just cast it to float and you’re ok.
[php]
Echoing html is considered bad practise, so please don’t do it like this:
oops…
I have read that using short tags isn’t compatible in some browsers, I haven’t found this the case (yet). However, using <?php ?> would be safer in my opinion.
Never heard (read) anything about browser compatibility but there can definitely be a PHP version issue. Of course if php was kept current, there would not be.
PHP code never reaches the browser so there is no browser incompatibility. There might be server incompability depending on what PHP version you use though.
Short tags
[php]<?
// code here
?>[/php]
and shorthand echoes
[php]<?= $foo ?>[/php]
are not the same thing.
Afaik all short tags were enabled by default up to PHP 5.3, while on 5.3 they were disabled. Since PHP 5.4 shorthand echoes are enabled by default, even if the short tags are disabled.
tl:dr
There shouldn’t be much problem using shorthand echoes. And the reason for them beeing enabled by default in PHP 5.4 onwards is that they are recommended as they clean up the views quite a lot.
thanks guys, thinking back, I probably need to format this at creation. I’m playing with a calculator.
Of course the numbers may/may not be currency, if not , No need for currency indicators, only “,”
Yeah, misread