Exponential Values
Author Message Exponential Values
Dividing 2.0/312659.0 gives me 6.3967454E-6

After this point i cannot do any arithmetical operations
with this number!(Exponential Value)

Is there a way to convert the value 6.3967454E-6 into
something like that :6.3967 ?

I know that i can convert 6.3967454E-6 into a varchar, cut
and throw away 'E-6' and then convert 6.3967454 into a
decimal again, but i really think that there is something
more prettier in SQl SERVER, there is gotta be....

Sat, 22 May 2004 05:27:42 GMT  Exponential Values

The result is a very very small number, not 6.39 or anything like
that.  (Throwing away the E-6 at the end would be multiplying the
value by one million.)

What do you mean "you cannot do" anything with this number?  In
what context?  For example if you store it in a Transact-SQL
variable of type "float" you should be able to work with it.

Quote:
> Dividing 2.0/312659.0 gives me 6.3967454E-6

> After this point i cannot do any arithmetical operations
> with this number!(Exponential Value)

> Is there a way to convert the value 6.3967454E-6 into
> something like that :6.3967 ?

> I know that i can convert 6.3967454E-6 into a varchar, cut
> and throw away 'E-6' and then convert 6.3967454 into a
> decimal again, but i really think that there is something
> more prettier in SQl SERVER, there is gotta be....

Sat, 22 May 2004 05:55:54 GMT  Exponential Values
What i really need to do is round that Exponential value.

round(6.3967454E-6,0) gives me zero, whatever i convert
this number into(float, decimal, etc), i need to get in
this case 6, if this value was 6.583455E-6 i should get 7.

All i need to do is implement Round() finction to this
exponential value, which i can't do....

Quote:
>-----Original Message-----
>The result is a very very small number, not 6.39 or
anything like
>that.  (Throwing away the E-6 at the end would be
multiplying the
>value by one million.)

>What do you mean "you cannot do" anything with this
number?  In
>what context?  For example if you store it in a Transact-
SQL
>variable of type "float" you should be able to work with
it.

>> Dividing 2.0/312659.0 gives me 6.3967454E-6

>> After this point i cannot do any arithmetical operations
>> with this number!(Exponential Value)

>> Is there a way to convert the value 6.3967454E-6 into
>> something like that :6.3967 ?

>> I know that i can convert 6.3967454E-6 into a varchar,
cut
>> and throw away 'E-6' and then convert 6.3967454 into a
>> decimal again, but i really think that there is
something
>> more prettier in SQl SERVER, there is gotta be....

>.

Sat, 22 May 2004 06:07:36 GMT  Exponential Values
I don't mean to be crass, but do you understand exponentials?
6.3967454E-6 equates to .0000063967454

In what world would rounding .0000063967454 to 6 make any sense at all?
Either way, you could do what someone else suggested and multiply the number
by 1,000,000, and then round it to get 6.

Zach

Quote:
> What i really need to do is round that Exponential value.

> round(6.3967454E-6,0) gives me zero, whatever i convert
> this number into(float, decimal, etc), i need to get in
> this case 6, if this value was 6.583455E-6 i should get 7.

> All i need to do is implement Round() finction to this
> exponential value, which i can't do....

> >-----Original Message-----
> >The result is a very very small number, not 6.39 or
> anything like
> >that.  (Throwing away the E-6 at the end would be
> multiplying the
> >value by one million.)

> >What do you mean "you cannot do" anything with this
> number?  In
> >what context?  For example if you store it in a Transact-
> SQL
> >variable of type "float" you should be able to work with
> it.

> >> Dividing 2.0/312659.0 gives me 6.3967454E-6

> >> After this point i cannot do any arithmetical operations
> >> with this number!(Exponential Value)

> >> Is there a way to convert the value 6.3967454E-6 into
> >> something like that :6.3967 ?

> >> I know that i can convert 6.3967454E-6 into a varchar,
> cut
> >> and throw away 'E-6' and then convert 6.3967454 into a
> >> decimal again, but i really think that there is
> something
> >> more prettier in SQl SERVER, there is gotta be....

> >.

Sat, 22 May 2004 06:21:20 GMT  Exponential Values

Quote:
> What i really need to do is round that Exponential value.

> round(6.3967454E-6,0) gives me zero,

That's because the number you're dealing with
is approximately 0.0000063967454. Round that to
zero decimal places and you get 0.

Maybe what you want is round(6.3967454E-6, 7)?

To get to 6.0 (which seems to be what you're asking
for), you would have to multiply by 10^6
(1 million), *then* round to zero decimal places.

Tim Heckman

Sat, 22 May 2004 06:24:22 GMT

 Page 1 of 1 [ 5 post ]

Relevant Pages