I want to format my input string with decimals in the following way: Input: 12857.40 - Output: 12857.4 Input: 20952.99048000 - Output = 20952.99048 So basically wanting output till the last number not zero Thanks ...