Javier,

WORKED PERFECT! THANK YOU ALL SO MUCH! :)

On Feb 3, 9:50 am, Javier Rivera <[email protected]> wrote:
> Chris McComas wrote:
> > I tried this, but no luck:
>
> > new_green.hp_coursepoints = Decimal(new_green.hp_grade) *
> > hp_credithours
>
> Decimal can't directly convert floats to decimals.
>
> Try:
>
> new_green.hp_coursepoints = Decimal(str(new_green.hp_grade)) *
> hp_credithours
>
> or
>
> new_green.hp_coursepoints = Decimal("%.2f" % new_green.hp_grade) *
> hp_credithours
>
> if you prefer to round hp_grade to a fixed number of decimals before
> doing the math.
>
> Javier.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to