Re: round to the nearest 10 or 100

2011-11-09 Thread Dr.Ruud
On 2011-11-08 20:02, Noah wrote: I am trying to round to 10 or 100 for particular values so the following numbers 530 570 would become 500 600 perldoc -q round perl -wle ' print sprintf q{%.0f00}, $_ / 100 for 530, 570, -530, -570; ' -- Ruud -- To unsubscribe, e-mail: beginners-un

Re: round to the nearest 10 or 100

2011-11-08 Thread Rob Dixon
On 08/11/2011 19:02, Noah wrote: Hi there, I am trying to round to 10 or 100 for particular values so the following numbers 530 570 2330 2590 3630 3660 would become 500 600 2300 2600 3600 3700 any clues how to do this well? The classical method uses sprintf, as in the code snippet below. H

Re: round to the nearest 10 or 100

2011-11-08 Thread Noah
On 11/8/11 11:36 AM, Shlomi Fish wrote: Hi Noah, On Tue, 08 Nov 2011 11:02:39 -0800 Noah wrote: Hi there, I am trying to round to 10 or 100 for particular values so the following numbers 530 570 2330 2590 3630 3660 would become 500 600 2300 2600 3600 3700 any clues how to do this well?

Re: round to the nearest 10 or 100

2011-11-08 Thread Shlomi Fish
Hi Noah, On Tue, 08 Nov 2011 11:02:39 -0800 Noah wrote: > Hi there, > > I am trying to round to 10 or 100 for particular values > > so the following numbers > 530 > 570 > 2330 > 2590 > 3630 > 3660 > > would become > 500 > 600 > 2300 > 2600 > 3600 > 3700 > > any clues how to do this well? >

Re: round to the nearest 10 or 100

2011-11-08 Thread Jim Gibson
On 11/8/11 Tue Nov 8, 2011 11:02 AM, "Noah" scribbled: > Hi there, > > I am trying to round to 10 or 100 for particular values > > so the following numbers > 530 > 570 > 2330 > 2590 > 3630 > 3660 > > would become > 500 > 600 > 2300 > 2600 > 3600 > 3700 > > any clues how to do this well? De

Re: round to the nearest 10 or 100

2011-11-08 Thread Paul Johnson
On Tue, Nov 08, 2011 at 11:02:39AM -0800, Noah wrote: > Hi there, > > I am trying to round to 10 or 100 for particular values > > so the following numbers > 530 > 570 > 2330 > 2590 > 3630 > 3660 > > would become > 500 > 600 > 2300 > 2600 > 3600 > 3700 > > any clues how to do this well? The usu

Re: round to the nearest 10 or 100

2011-11-08 Thread Noah
what you're try to accomplish. 1 : 0 2 : 0 3 : 0 4 : 0 5 : 10 6 : 10 ... 9 : 10 10 : 10 11 : 10 ... etc. okay so I am trying to round to the nearest 10 or 100. There would need to be round up and round down capabilities. So example numbers would be 530 rounds down to 500, 570 rounds

Re: round to the nearest 10 or 100

2011-11-08 Thread Shawn H Corey
On 11-11-08 02:02 PM, Noah wrote: I am trying to round to 10 or 100 for particular values so the following numbers 530 570 2330 2590 3630 3660 would become 500 600 2300 2600 3600 3700 any clues how to do this well? Make a more comprehensive list of what you're try to accomplish. 1 : 0 2

round to the nearest 10 or 100

2011-11-08 Thread Noah
Hi there, I am trying to round to 10 or 100 for particular values so the following numbers 530 570 2330 2590 3630 3660 would become 500 600 2300 2600 3600 3700 any clues how to do this well? Cheers, Noah -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mai