Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- convert string with comma into an integer
June 27, 2005, 8:00 pm
rate this thread
Re: convert string with comma into an integer
Insufficient information.You didn't even tell us what result you expect:
- do you want to round? This would yield 5 in your example but it would
yield 4 for e.g. 4,123
- or do you want take just the integer portion, e.g. 4 in your example and
for 4,123. Then there is still the question what you want to happen for
negative numbers, e.g. -4,674. Do you want the integer portion (-4) or the
next lower number (-5).
Anyway, "perldoc -q round" will probably get you started.