It looks like you have an empty value in the table row where you experience 
the error.

On Thursday, February 13, 2014 6:49:44 AM UTC-5, Robin Manoli wrote:
>
> Hey,
> I have a decimal in db, for which I tried numerous ways to round to two 
> decimal points, and also to calculate with other numbers. Basically I want 
> to convert it to a float, but could find no way to do so.
>
> The Field looks like this:
> Field('score', 'decimal(4,3)')
>
> It does work to convert to string such as:
>     {{=str(t.score)}}
> but neither does this work:
>     {{=float(str(t.score))}} # error: <type 'exceptions.ValueError'> could 
> not convert string to float: None"
> and nor this:
>     {{=float(t.score)}} # error: <type 'exceptions.TypeError'> float() 
> argument must be a string or a number
>
> I even tried to import decimal and calculate that with t.score, but even 
> that didn't work! What's going on?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to