From: lennie on
Hi group!

Apologies if this is trvial for you, but I try to construct a s/ / /g that
will insert a - for every third digit in a number from right to left, ie:
123456 -> 123-456
1234567 -> 1-234-567
123 -> 123 (no - as first char)
etc..

It might be possible to do this with a cpan library function, but I would
like to have this done in a simple sentence.

Regards
Erling


From: lennie on
Thanks all. This was helpful.

Regards
Erling

"lennie" <erling.kopperdal(a)lyse.net> skrev i melding
news:ltqdnRPPT_lVN93RnZ2dnUVZ7tednZ2d(a)lyse.net...
> Hi group!
>
> Apologies if this is trvial for you, but I try to construct a s/ / /g that
> will insert a - for every third digit in a number from right to left, ie:
> 123456 -> 123-456
> 1234567 -> 1-234-567
> 123 -> 123 (no - as first char)
> etc..
>
> It might be possible to do this with a cpan library function, but I would
> like to have this done in a simple sentence.
>
> Regards
> Erling
>