The standard Float field in ProcessWire can be used to store monetary fields but:
- You can lose precision when doing calculations
- They aren’t always displayed to two decimal places
It's much better to use a Decimal field.
- Go to Modules > Core
- Click the Install button next to Decimal
- Create any monetary fields as Decimal and in the Details tab for the field choose No for Are blank and 0 equivalent? (this ensures the trailing zeros are displayed)
Tim Bennett is a Leeds-based web designer from Yorkshire. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.