Hi,
I cannot understand how can I correctly validate input of decimal numbers with comma decimal separator (eg. 12,34)...
Assuming I have a very simple model:
@Entity
class Product {
public String name;
public float price;
}
and a controller action in which I save the object:
public static void save(@Valid Product product) {
if (validation.hasErrors()) {
params.flash();
validation.keep();
editProduct(product);
} else {
product.save();
}
}
When play validates the object for price with comma decimal delimiter "12,34" it correctly rejects it because it is not a valid number, right, but I want accept the value with comma decimal delimiter...
How can I do ?
I know that in France the decimal separator is comma (like in Italy), is there anyone that has solved the problem and can show me a code example ? I cannot found any working solution at the moment...
Please help me..., many thanks in advance...