printf format for logarithmic spinner

Discussion in 'C Programming' started by Malcolm McLean, Oct 15, 2013.

  1. I'm adding a spinner to Baby X.

    Sometimes you want to adjust numbers logarithmically, i.e. the delta is multiplied by the absolute value of the number, so you get fine adjustment for tiny numbers and a big adjustment for large numbers.
    I've used the format %.2g for displaying the numbers. This gives good results (7 characters) when the spinner is forced into exponential notation. But it does mean that in the middle of the range, space is wasted.
    Is there a better format specifier to use?
    Malcolm McLean, Oct 15, 2013
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.