Re: [R] Format wanted...

2012-03-25 Thread Hasan Diwan
Duncan, On 25 March 2012 15:28, Duncan Murdoch wrote: > In case anyone is interested, I want to output code in a language (GLSL) > that sees 1 and 1. as different types.  I want a floating point value, so I > need the decimal point. GLSL, assuming it's the one that I'm looking at[1], supports im

Re: [R] Format wanted...

2012-03-25 Thread Duncan Murdoch
On 12-03-25 10:45 AM, Marc Schwartz wrote: On Mar 25, 2012, at 7:14 AM, Duncan Murdoch wrote: On 12-03-24 10:47 PM, J Toll wrote: On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch wrote: Do we have a format that always includes a decimal point and a given number of significant digits, but o

Re: [R] Format wanted...

2012-03-25 Thread Marc Schwartz
On Mar 25, 2012, at 7:14 AM, Duncan Murdoch wrote: > On 12-03-24 10:47 PM, J Toll wrote: >> On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch >> wrote: >>> Do we have a format that always includes a decimal point and a given number >>> of significant digits, but otherwise drops unnecessary charac

Re: [R] Format wanted...

2012-03-25 Thread Duncan Murdoch
On 12-03-24 10:47 PM, J Toll wrote: On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch wrote: Do we have a format that always includes a decimal point and a given number of significant digits, but otherwise drops unnecessary characters? For example, if I wanted 5 digits, I'd want the following:

Re: [R] Format wanted...

2012-03-24 Thread J Toll
On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch wrote: > Do we have a format that always includes a decimal point and a given number > of significant digits, but otherwise drops unnecessary characters?  For > example, if I wanted 5 digits, I'd want the following: > > Round to 5 digits: > 1.234567

[R] Format wanted...

2012-03-24 Thread Duncan Murdoch
Do we have a format that always includes a decimal point and a given number of significant digits, but otherwise drops unnecessary characters? For example, if I wanted 5 digits, I'd want the following: Round to 5 digits: 1.234567 -> "1.2346" Drop unnecessary zeros: 1.23 -> "1.23" Force