I agree. Ideally, sagetex would work with the numprint package and the different language packages for babel,so that users of sagetex and those packages wouldn't need to do anything different. Or, as I think you imply, an option within sagetex.
Oscar On Mar 23, 7:34 pm, Dan Drake <dr...@kaist.edu> wrote: > On Tue, 23 Mar 2010 at 07:25AM -0700, iDan wrote: > > Hi, > > In french, we use comma as decimal separator. How can I convert the > > result of the instruction \sage{} (from sagetex package) ? > > Hrm, unfortunately, I don't think this is possible right now. > > You can have Sage insert a comma in this way: > > sage: x = 1.234 > sage: x.str().replace('.', ',') > '1,23400000000000' > > so in your TeX file, you could do > > $\sage{(sqrt(3)).str().replace('.', ',')}$ > > which is not very pleasant. > > You could define a small function which makes this nicer: > > \begin{sagesilent} > def numprint(x): > return x.str().replace('.', ',') > \end{sagesilent} > > and then use \sage{numprint(x)}, which is a bit nicer. > > Python has a bit of support for locale-dependent printing, which I > should go investigate. > > I think the real long-term solution is to change the str() method to > allow commas as the decimal separator and create a configuration option > so that a user can say "use commas always". > > Dan > > -- > --- Dan Drake > ----- http://mathsci.kaist.ac.kr/~drake -- 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 URL: http://www.sagemath.org To unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.