I'm only aware of https://github.com/lindahua/Formatting.jl so I'd welcome 
pointers about the other packages, so we can pool efforts and ideas. 

Please note that my package only tries to focus on formatting 1 number at a 
time. It's easy to concatenate strings in Julia, so I didn't worry about 
replicating the full varargs functionalities of sprintf.

On Friday, November 21, 2014 9:18:39 PM UTC+7, Tim Holy wrote:
>
> Looks really nice. There are several packages that have been dipping into 
> the 
> guts of Base.Grisu, this looks like a promising alternative. 
>
> --Tim 
>
> On Friday, November 21, 2014 12:48:35 AM Tony Fong wrote: 
> > I just wrote a package that may do what you need in runtime. 
> > 
> > https://github.com/tonyhffong/NumFormat.jl 
> > 
> > It's not in METADATA yet, since I'm not sure if its implementation is 
> > kosher. (There's a trick of generating new generic functions at runtime 
> > within the module name space). 
> > 
> > Speed is decent (within 30% of standard macro). You can run the test 
> script 
> > to see the difference on your machine. 
> > 
> > After you clone it, you can try 
> > 
> > using NumFormat 
> > 
> > format( 12345678, commas=true) # method 1. slowest, but easiest to 
> change 
> > format in a readable way 
> > 
> > sprintf1( "%'d, 12345678 ) # method 2. closest to @sprintf in form, so 
> one 
> > can switch over quickly 
> > 
> > f = generate_formatter( "%'d" ) # method 3. fastest if f is used 
> repeatedly 
> > f( 12345678 ) 
> > 
> > Tony 
> > 
> > On Saturday, November 8, 2014 6:05:08 PM UTC+7, Arch Call wrote: 
> > > How would I use a @printf macro to use commas for thousands separators 
> in 
> > > integers? 
> > > 
> > > @printf "%d \n" 12345678 
> > > 
> > > This outputs:  12345678 
> > > 
> > > I would like the output to be:   12,345,678 
> > > 
> > > Thanks...Archie 
>
>

Reply via email to