Welcome Guest, Not a member yet? Register   Sign In
Form validation with Greater Than won't work with international currencies (comma separated decimal numbers)
#1

[eluser]landitus[/eluser]
Hi, I was trying out the form validation Greater Than like this:
Code:
$this->form_validation->set_rules('value','Value','required|max_length[128]|xss_clean|greater_than[299]');

I'm using this for currency. So I tested with the amount 300,50 and it shows a validation error. The error says it should be greater than 300. In Argentina (and many other countries I presume) currency numbers have the following format:

- 500,40
- 1.000,40

We use the comma to separate the cents and the dot to (optionally) notate thousands. Is there a way to extend the validation or set the separator to a custom value? I feel this could be useful to other international users.


Messages In This Thread
Form validation with Greater Than won't work with international currencies (comma separated decimal numbers) - by El Forum - 04-24-2012, 04:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB