is part of an array declaration that makes it valid syntax. (ETA - his later post shows a bit more of it as part of a function call, not quite where I was thinking of).
This doesn’t seem an appropriate column type for a numeric balance.
I recall you asked before about changing the way a number was displayed, using this same template system that sits on top of the standard html. I recall you mentioned you’d sorted it, but I don’t think you said how.
To clarify, are you trying to change the way it’s stored in the database (as part of your call to $db->update() or are you trying to change the way it’s displayed? The latter would be better.
Agreed, it makes no sense to store numeric values as varchar.
Being a decimal value decimal may be a good choice of data type for that column. When you define the column format you also define the number of decimal places, along with the total number of digits (including decimals). So 0000.0 would be decimal (5, 1) that’s five digits and one decimal place, adjust the numbers to what you need, considering the maximum expected values, which in that example would be: 9999.9
Though one decimal for currency still seems odd to me as most currencies are divided into cents (or variations of).
Thanks for your reply/info.
I have followed your instructions and the ‘balance’ column structure now shows:
Default: As Defined 0.0
yet, the html displayed number still shows as 0.00
Maybe you could comment on adding something like this:
In there, you ask about how to get it to display earnings with a decimal place, then a couple of posts later, you got it working. So perhaps you could have a look back at what you did there to make the display as you wanted.
What’s the name of the template system you use? I’m sure someone else knew what it was in another post but I can’t remember. I wonder whether whatever part of it translates
into displaying that actual variable you pass in also handles formatting it, and that would explain why, whatever format you pass into it, it still comes out the same.