How can I format an input value to have 2 decimal places in Play! framework 2? For example, I want a price to look like “100.00”, but its showing up as “100.0”. Do I do it with an annotation on the model, or a parameter on the input in the form?
I tried this but it doesn’t change the format:
@inputText(myForm("price"), 'format -> "###.##")
I changed the data type from Double to BigDecimal and set the scale to 2. This automatically handled formatting it.