# convert user input into a percentage value?

Page 1 of 1

## 1 Replies - 349 Views - Last Post: 23 July 2012 - 04:47 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=286669&amp;s=56480bf97d567ea308fcfbdbc79da479&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 crohnsandme

Reputation: 0
• Posts: 23
• Joined: 17-July 12

# convert user input into a percentage value?

Posted 23 July 2012 - 04:19 AM

hi all , so i need to do a task which user inputs start amount and final amount and then interest and would out how many years it takes for the start amount to be at least final amount going by the users interest.

i understand the command

reads in the users input and converts it into double type but how do i get it to move the decimal to the right 2 places? because when i do

```start = (start + (interest * start));
```

to work out the new amount of the start with the added interest it isnt correct because say 5% is going in as 5 and not 0.05?

thanks

Is This A Good Question/Topic? 0

## Replies To: convert user input into a percentage value?

### #2 crohnsandme

Reputation: 0
• Posts: 23
• Joined: 17-July 12

## Re: convert user input into a percentage value?

Posted 23 July 2012 - 04:47 AM

im very sorry i know how to do it now i just was overlooking it , i divided the user input by 100 which moves the decimal places across if someone wants to delete this thread please carry on thanks