Join Slack
Powered by
That Amount column is float in the database. Shoul...
# cfml-beginners
f
Formiko
05/04/2022, 3:11 AM
That Amount column is float in the database. Should I change it?
p
Patrick
05/04/2022, 3:49 AM
https://cfdocs.org/dollarformat
a
Adam Cameron
05/04/2022, 6:16 AM
@Formiko
did you put
any
effort in to checking the docs for yourself before asking us? Or even just google?
👏 1
👏🏻 1
Adam Cameron
05/04/2022, 6:20 AM
I mean just googling "
cfml How can I make a format mask for money
" answers your question on the first page of results (
https://www.google.com/search?q=cfml+How+can+I+make+a+format+mask+for+money&oq=cfml+How+can+I+make+a+format+mask+for+money
). And using a more sensible search string is, unsurprisingly, even more focused:
https://www.google.com/search?q=cfml+money+format
a
aliaspooryorik
05/04/2022, 8:15 AM
Slightly off topic - but I would strongly recommend storing monetary values as integers (so cents / pence instead of dollars and pounds). Then any maths operations you do are on integers and you just
display
with decimal places.
✅ 1
a
Adam Cameron
05/04/2022, 10:36 AM
yeah and
def
not as a float
☝️ 2
2
Views
Open in Slack
Previous
Next