This should round when cents are higher than 50.
Unfortunately it doesn't work if @cent[1] is a value with zero like = @cent[0].60 or .50. ecc.
(It works only for a "full" value like .61, .53 ecc. ) I guess perl is removing zero.
code:
-----
@cent = split/\./,$lit;
@cent[1] = substr(@cent[1], 0, 2);
$lit++ if (@cent[1] > 50);
$lit=~s/.@cent[1]//;
----
Any suggestions to fix this?
Thanks.
Unfortunately it doesn't work if @cent[1] is a value with zero like = @cent[0].60 or .50. ecc.
(It works only for a "full" value like .61, .53 ecc. ) I guess perl is removing zero.
code:
-----
@cent = split/\./,$lit;
@cent[1] = substr(@cent[1], 0, 2);
$lit++ if (@cent[1] > 50);
$lit=~s/.@cent[1]//;
----
Any suggestions to fix this?
Thanks.