Seamlessly storing and displaying dollars and cents (not just 99, but $99.00; not just 99.1, but $99.10) would be helpful. A currency type on a field would be similarly helpful for making it seamless throughout. No need to store the “$”, just show it in the field next to the stored value, but always store the value with two decimal points, or at least cleanly display it with two decimal points.
Bonus: developer selectable option to show or not show cents, i.e. force even dollar amounts.
Not 100% sure I understand you, and my apologies if I have got the wrong end of the stick.
If you have a variable, say
dollar_value = 99.1
then displaying that would be :
self.label_value.text = "$" + str(round(float(dollar_value),2))
which could easily be made into a class method/function.
ah, yes, can do that every time… but i failed to specify that i’m looking at column types in data tables and text box types (not labels) in the IDE. text boxes currently have text, number, email, tel, and url as type options.
ultimately, i want to write less code. “$” + str(round(float(dollar_value),2)) is fine, works for labels, but a textbox of type: number won’t cooperate at all currently, it drops the trailing zeros. adding currency support could both show a “$” at the beginning as well as enforce two decimal points.
Ah, I see!
(some text to make up 20 characters
)