Consider I have some double number, I want to truncate it(not round) and leave 4 digits after floating point(exactly 4, always 4, if there are not enough digits - add zeros). Examples:
2344.4234934 -----> 2344.4234
1.345584 -----> 1.3455
34.3434 -------> 34.3434
0.123 ------> 0.1230
1 ---------> 1.0000
I'm using java language, and I'm asking for some built-in functions. I have a solution already but it's too complicated, may be there is an elegant one.
Try this