Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Change decimal point temporarily

by nvivek (Vicar)
on Aug 03, 2010 at 04:51 UTC ( #852594=note: print w/replies, xml ) Need Help??

in reply to Change decimal point temporarily

You can use the substitute command to do this.If you want to replace the . for only numerals.Before replacing,you can check whether that variable has numerals or not by using regular expression in substitute command as follows.

$no=123.45; $no=~s/^(\d+)\.(\d+)/$1,$2/;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://852594]
Discipulus open a red wine bottle and ..
Discipulus adds tozzetti alle mandorle to the platter on the sideboard.
[Discipulus]: the most monastic cookie!
[choroba]: Discipulus BTW, I loved Settembrini by Mulino Bianco years ago in Italy
[choroba]: then they stopped producing them...
[choroba]: But it seems they make them again?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-04-27 10:37 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (503 votes). Check out past polls.