>just out of curiosity - how did you get all those trailing zeros ?
>From  the python schell ..
May be the printed velue was 
304.8000000000001
I just make a mistake in copy paste .. ;-)

Regards,
Matteo

-----Original Message-----
From: sympy@googlegroups.com [mailto:sy...@googlegroups.com] On Behalf Of
Sebastian Haase
Sent: 17 June 2010 09:12
To: sympy@googlegroups.com
Subject: Re: [sympy] conversion units

On Thu, Jun 17, 2010 at 3:10 AM, smichr <smi...@gmail.com> wrote:
> Matteo asked a question about units (but hijacked another discussion
> to do so) :-)
>
> -------------
> Hi All,
> I'm trying to use sympy for units conversion..
> I use this code to convert from ft to mm..
> cad_leng=units.Unit('cad_leng','mm')
> converter={units.m: cad_leng*Rational(1000)}
> cad_ft=units.ft
> cad_mm=cad_ft.subs(converter)
> mm_value=float(str(cad_mm.evalf()).split('*')[0])
> print mm_value
> 304.8
>
> Is this right ?
> Or there are any other method to get it ?
> -------------
>
> Matteo, I would do it like this:
>
>>>> from sympy.physics import units as u
>>>> u.feet/u.mm
> 1524/5
>>>> _.n()
> 304.800000000000
>
ok, let's keep hijacking...
just out of curiosity - how did you get all those trailing zeros ?

thanks and sorry for the off-topic question,
Sebastian

-- 
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to