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
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
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?
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?
>
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
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
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
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
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