# Best practise for non-us formated numbers in parameters

**URL:** <https://www.ruby-forum.com/t/best-practise-for-non-us-formated-numbers-in-parameters/184578>\
**Category:** Rails\
**Created:** [March 4, 2010, 8:26pm UTC](https://www.ruby-forum.com/t/best-practise-for-non-us-formated-numbers-in-parameters/184578 "2010-03-04T20:26:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6bbea6/32.png) [@jarl](https://www.ruby-forum.com/u/jarl)\
**Post date:** [March 4, 2010, 8:26pm UTC](https://www.ruby-forum.com/t/best-practise-for-non-us-formated-numbers-in-parameters/184578/1 "2010-03-04T20:26:45Z")

</div>

I have a contrller that receives data (by POST requests) from an  
external system. The external system formats the number according to  
danish traditon, that is PI=3,1415, and 3/4 = 0,75.

This gives me problems in my activerecord when specifying these  
attributes to numeric, that is using  
validates\_numericality\_of :danish\_number  
in my AR model. Even when that is solved, I also want the AR framework  
to automatically coerce these values as numbers (not strings), so when  
the INSERT statement is generated, the DB will not generate errors.

All my other contrllers and AR models use standard formatting.

What is the best approach? I would like to specify this on the AR  
model level.

Jarl
