Hello,
I'm trying to convert a numeric value to a string, but I don't want it to round up the decimal point. Is there a way to do this?
NumValue = 0.1275
I need the string to be "0.12"
If I use str(NumValue,4,2) the value is rounded to " 0.13". Maybe there is a way to truncate the string from the right side. If I converted the value using str(NumValue,6,4) I would get a " 0.1275" and then I could just truncate the last two digits. But I can't figure out a way to do this. Could anyone help please??
Thanks,
Erik
I'm trying to convert a numeric value to a string, but I don't want it to round up the decimal point. Is there a way to do this?
NumValue = 0.1275
I need the string to be "0.12"
If I use str(NumValue,4,2) the value is rounded to " 0.13". Maybe there is a way to truncate the string from the right side. If I converted the value using str(NumValue,6,4) I would get a " 0.1275" and then I could just truncate the last two digits. But I can't figure out a way to do this. Could anyone help please??
Thanks,
Erik