Re: [racket-users] what do people use for number formatting?

2018-05-08 Thread Neil Van Dyke
My ancient, half-finished R4RS Scheme number-formatting library is still used by at least one program.  When I moved that library to the Racket new package system, I made an effort to deprecate it. But anyone improving modern-day idiomatic Racket formatting might want to take a quick peek at

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread 'John Clements' via Racket Users
Well, that was easy! As usual, can’t believe I didn’t know that was there. Many thanks to all, John > On May 7, 2018, at 5:00 PM, Daniel Prager wrote: > > ~r works nicely: > > > (~r 1.237472387 #:precision 2) > "1.24" -- You received this message because you

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Daniel Prager
~r works nicely: > (~r 1.237472387 #:precision 2) "1.24" -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Alexis King
I second ~r. It will round when given a precision. > On May 7, 2018, at 18:56, Stephen Chang wrote: > > Oops, I didnt see the rounding. > > On Mon, May 7, 2018 at 7:53 PM, Ben Greenman > wrote: >> I use this: >>

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Stephen Chang
Oops, I didnt see the rounding. On Mon, May 7, 2018 at 7:53 PM, Ben Greenman wrote: > I use this: > http://docs.racket-lang.org/gtp-util/index.html#%28def._%28%28lib._gtp-util%2Fmain..rkt%29._rnd%29%29 > > I didn't know about SRFI 54 --- looking forward to reading

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Stephen Chang
~r http://docs.racket-lang.org/reference/strings.html?q=~r#%28def._%28%28lib._racket%2Fformat..rkt%29._~7er%29%29 On Mon, May 7, 2018 at 7:46 PM, 'John Clements' via Racket Users wrote: > Okay, how many times have I written the function that accepts 1.237472387 and

Re: [racket-users] what do people use for number formatting?

2018-05-07 Thread Ben Greenman
I use this: http://docs.racket-lang.org/gtp-util/index.html#%28def._%28%28lib._gtp-util%2Fmain..rkt%29._rnd%29%29 I didn't know about SRFI 54 --- looking forward to reading other responses. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

[racket-users] what do people use for number formatting?

2018-05-07 Thread 'John Clements' via Racket Users
Okay, how many times have I written the function that accepts 1.237472387 and returns “1.24” ? What do you folks use? I see that SRFI 54 covers this use case, and a lot of others besides. Is this the most commonly used package for formatting numbers? John -- You received this message