stringbuffer - format numbers in java to remove decimals and add decimals -


i looking @ java code perform following 2 operations:-

if sending value 10.00, method should format 1000 ,

if getting 1000 in response 3rd party system, need convert 1000 10.00 in method. whatever decimal value (2 digit's after decimal) i'm sending need remove decimals , whatever non-decimal value i'm receiving need convert decimals (2 digits after decimals)

i tried write code it's not working expected. can please guide me? i'm using jdk 7.

you supposed provide own code doesn't work, can figure out , make work, not posting problem , let work.

input string , convert char array tochararray() method. rewrite array without dot first part. second part same thing except insert dot on position want.

btw question not clear enough, how algorithm work, happens if number 15, or 1555...does translate 0.15 , 15.55?


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -