Home All Groups Group Topic Archive Search About

Up/down value conversions

Author
29 Jun 2006 5:43 PM
Mike
Greetings,

We are using an up/down control to facilitate numeric data entry,
however, we are noticing issues converting from the up/down value
(apparently a Decimal) to the units we are working with (Double) and
vice versa. There appear to be precision issues, and then we take those
numbers and scale them according to our application requirements.
Needless to say, the results are anything but what we might expect. We
could be doing some wacky scaling, but notwithstanding that, is there
anything we can do to help clean up the conversion between Decimal and
Double? Or is the answer to provide a control that better-supports a
Double-compatible input? Any suggestions are welcome. Thanks in
advance.

Regards,
Michael Powell

Author
29 Jun 2006 10:41 PM
Jared Parsons [MSFT]
Hello Mike,

> Greetings,
>
> We are using an up/down control to facilitate numeric data entry,
> however, we are noticing issues converting from the up/down value
> (apparently a Decimal) to the units we are working with (Double) and
> vice versa. There appear to be precision issues, and then we take
> those numbers and scale them according to our application
> requirements. Needless to say, the results are anything but what we
> might expect. We could be doing some wacky scaling, but
> notwithstanding that, is there anything we can do to help clean up the
> conversion between Decimal and Double? Or is the answer to provide a
> control that better-supports a Double-compatible input? Any
> suggestions are welcome. Thanks in advance.

How are you converting from the Decimal to Double currently? 

--
Jared Parsons [MSFT]
jared***@online.microsoft.com
All opinions are my own. All content is provided "AS IS" with no warranties,
and confers no rights.
Author
3 Jul 2006 4:21 PM
Mini-Tools Timm
Show quote
"Mike" wrote:

> Greetings,
>
> We are using an up/down control to facilitate numeric data entry,
> however, we are noticing issues converting from the up/down value
> (apparently a Decimal) to the units we are working with (Double) and
> vice versa. There appear to be precision issues, and then we take those
> numbers and scale them according to our application requirements.
> Needless to say, the results are anything but what we might expect. We
> could be doing some wacky scaling, but notwithstanding that, is there
> anything we can do to help clean up the conversion between Decimal and
> Double? Or is the answer to provide a control that better-supports a
> Double-compatible input? Any suggestions are welcome. Thanks in
> advance.

Try using Convert.ToDouble( decimal val )

--
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com

AddThis Social Bookmark Button