Jump to content

Recommended Posts

I have been developing an android app, and I am stuck on some math (One thing I am not too good with).

 

So, I have a slide bar that you can drag left to right. By Default all the way left is 0 and all the way right is 100. I am trying to find a formula that will make all the way left will simulate -100 and all the way right will simulate +100 and 0 would be dead center.

 

For those not familiar with android programming, the event passes a position value to the event listener, which is a number between 0 and 100. I would like to take that number and convert it from -100 to +100.

 

Thanks for the help!

Link to comment
https://forums.phpfreaks.com/topic/270459-some-simple-math/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.