thank you very much for sharing this!

maurizio

On 15 Lug, 21:47, dw <dwe...@structuralcomponents.net> wrote:
> I was able to find a solution to my problem.  If anyone else wants to
> do the same thing, I added the following function to  unum/__init_.py.
>
>    def round(self, sig_fig):
>       ''' returns a string representation of the number w/ units
>           showing only the set number of significant digits
>       '''
>       return '%s %s' % (round(self.asNumber(),sig_fig), self.strUnit
> ())
>
> This just gives you a method to print the number of desired digits.
>
> On Jul 14, 12:08 pm, dw <dwe...@structuralcomponents.net> wrote:
>
> > I've been evaluating Sage for engineering applications.  The one
> > missing part, which after reading this forum I've realized is
> > currently being worked on, is unit support.  The best solution I've
> > been able to use so far is Unum.  It works well in my application, but
> > in the notebook I'd like to be able to limit the number of digits
> > shown.  I'd previously been using print '%.3f" to set the display, but
> > it doesn't work with Unum numbers.  I'm sure this would be better
> > asked in an Unum forum, but I haven't found one and it seems a few
> > people here have used the package.
> > Also, on a more general note.  Can you set the significant digits
> > displayed throughout a notebook somehow?
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to