Not sure what might come in your way here, so I just made the following simple test by using a static value rather than one which gets derived from a recordset (the source shouldn´t matter), and this works well for me without seeing the value altered in any way:
$value = "10.22";
<input type="text" name="whatever" value="<?php echo htmlentities($value, ENT_COMPAT, 'UTF-8'); ?>" />
However,. for displaying numeric values you really don´t need to use htmlentities/ENT_COMPAT etc etc -- that´s something you´d rather use for displaying textual contents containg special characters like umlauts and such.
If all you need is to add some degree of protection by escaping special HTML characters (<, >, &, etc.), the function htmlspecialchars() will only be escaping just these characters and leave the rest "as is", whereas htmlentities() is notably more rigi, because this function will convert all applicable characters to HTML entities -- but again: at this point you´re just *displaying* some numeric value, that is, such security measures are pretty much pointless in this scenario, because there´s nothing to protect from ;-)
Please test what happens when doing away with the htmlentities - thing.
You are so correct Gunter. Thanks for the advice. I ended up formatting
the numbers using
I think that was the rather simple answer.
glad to see this works for you !
Well, after posting my previous reply I noticed that you also posted the same question (with many more details) in the regular Dreamweaver Application Development forum -- let´s see what the answers will be like over there.
However, it would have been better to post in just one forum, and for standard PHP issues the regular Dreamweaver Application Development forum will be the better option anyway, because this one is meant for discussing all things about the (discontinued) Extension "Dreamweaver Development Toolbox" (ADDT), which generates non-standard PHP code.
Very good, Thanks for your guidance