Question: > 
> **Possible Duplicate:**  
> 
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
> 
> 
> 

Hi All,

Doing something like this

```
alert(999999999999999999999999999999999999999999999999);

```

results in this

![Javascript Popup 1e+48](https://i.stack.imgur.com/YQVoz.png)

How to i stop converting a number to a string from saying 1e+XX or Infinity?

Answer: 
You can pass `:allow_blank` as an option to allow this:

```
validates_length_of :some_field, :within => 0..10, :allow_blank => true

```
Maybe it's a nil value instead of an empty string that it gets validated against ?

```
irb(main):006:0> ''.length
=> 0
irb(main):007:0> nil.length
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.length
    from (irb):7

```