Thread View: comp.lang.basic.visual
5 messages
5 total messages
Started by Lasse Madsen
Thu, 07 Dec 2000 00:53
Help with adding 2 decimal numbers ! and exponents
Author: Lasse Madsen
Date: Thu, 07 Dec 2000 00:53
Date: Thu, 07 Dec 2000 00:53
26 lines
2638 bytes
2638 bytes
Hi there im a 1 year electronics student in denmark which has this problem: i have 2 values which i want to add (they are vairable) what i tourght i could do was text1.text = (example 0.0000004568 or 0.000000000100) text2.text = (same example as above) text3.text = result box as you might have figured is that im trying to add forinstance 10pico(p) with 1 micro(u) CODE WHICH DOESNT WORK ??? text3.text = Val(text1.text) + Val(text2.text) why do the above code doesnt work and what should i do ? and how could i make the outcome in exponent for instance if the outcome is 0.0001 the it shoud read 1e-4 ??? how can i do this ? Thanks alot for your reply ! ------------------------- Electronics Student Lasse Madsen H�jrupsvej 52, 2.m.f. 9900 Frederikshavn Denmark
Re: Help with adding 2 decimal numbers ! and exponents
Author: Laurens Brand
Date: Thu, 07 Dec 2000 00:00
Date: Thu, 07 Dec 2000 00:00
40 lines
2654 bytes
2654 bytes
Text1.Text = 0.0000004568
Text2.Text = 0.0000000001
Text3.Text = Format(CDec(Text1.Text) + CDec(Text2.Text), "Scientific")
Perhaps you can use this
Laurens Brand
"Lasse Madsen" <Lasse.Madsen@Elektronik.dk> schreef in bericht
news:90mm95$7u4$1@news.cybercity.dk...
> Hi there im a 1 year electronics student in denmark which has this
problem:
>
> i have 2 values which i want to add (they are vairable) what i tourght i
> could do was
>
> text1.text = (example 0.0000004568 or 0.000000000100)
> text2.text = (same example as above)
> text3.text = result box
> as you might have figured is that im trying to add forinstance 10pico(p)
> with 1 micro(u)
>
> CODE WHICH DOESNT WORK ???
> text3.text = Val(text1.text) + Val(text2.text)
>
> why do the above code doesnt work and what should i do ?
> and how could i make the outcome in exponent for instance if the outcome
is
> 0.0001 the it shoud read 1e-4 ??? how can i do this ?
>
> Thanks alot for your reply !
>
> -------------------------
> Electronics Student
> Lasse Madsen
> H�jrupsvej 52, 2.m.f.
> 9900 Frederikshavn
> Denmark
>
>
Re: Help with adding 2 decimal numbers ! and exponents
Author: Richard Kitchen
Date: Thu, 07 Dec 2000 02:36
Date: Thu, 07 Dec 2000 02:36
41 lines
2916 bytes
2916 bytes
Try this: val1# = val(text1.text) val2# = val(text2.text) text3 = str(val1 + val2) Hope this helps Richard Kitchen "Lasse Madsen" <Lasse.Madsen@Elektronik.dk> wrote in message news:90mm95$7u4$1@news.cybercity.dk... > Hi there im a 1 year electronics student in denmark which has this problem: > > i have 2 values which i want to add (they are vairable) what i tourght i > could do was > > text1.text = (example 0.0000004568 or 0.000000000100) > text2.text = (same example as above) > text3.text = result box > as you might have figured is that im trying to add forinstance 10pico(p) > with 1 micro(u) > > CODE WHICH DOESNT WORK ??? > text3.text = Val(text1.text) + Val(text2.text) > > why do the above code doesnt work and what should i do ? > and how could i make the outcome in exponent for instance if the outcome is > 0.0001 the it shoud read 1e-4 ??? how can i do this ? > > Thanks alot for your reply ! > > ------------------------- > Electronics Student > Lasse Madsen > H�jrupsvej 52, 2.m.f. > 9900 Frederikshavn > Denmark > >
Re: Help with adding 2 decimal numbers ! and exponents
Author: Lasse Madsen
Date: Thu, 07 Dec 2000 16:04
Date: Thu, 07 Dec 2000 16:04
56 lines
3377 bytes
3377 bytes
Thanks the adding of 2 decimal numbers now work ! ! ! but im still having trouble converting the numbers from the following code into prefix 'Frequency = 1 / T Text7.Text = (1 / Ttp.Text) & " Hz" Tf.Text = Format(CDec(Text7.Text), "Scientific") (text7.text is an extra box which holds the code of the actual equation and then Tf.text "should" show the PREFIX number it collected from text7.text) And if its possible i would like to know to to convert the "Tf.text" from above into "electro" langauge 500 p (or pico) (example 12e-12 = 12p) e6 = M = mega e3 = K = kilo e-3 = m = mili e-6 = u = mirco e-9 = n = nano e-12 = p = pico Thanks once again ! "Lasse Madsen" <Lasse.Madsen@Elektronik.dk> wrote in message news:90mm95$7u4$1@news.cybercity.dk... > Hi there im a 1 year electronics student in denmark which has this problem: > > i have 2 values which i want to add (they are vairable) what i tourght i > could do was > > text1.text = (example 0.0000004568 or 0.000000000100) > text2.text = (same example as above) > text3.text = result box > as you might have figured is that im trying to add forinstance 10pico(p) > with 1 micro(u) > > CODE WHICH DOESNT WORK ??? > text3.text = Val(text1.text) + Val(text2.text) > > why do the above code doesnt work and what should i do ? > and how could i make the outcome in exponent for instance if the outcome is > 0.0001 the it shoud read 1e-4 ??? how can i do this ? > > Thanks alot for your reply ! > > ------------------------- > Electronics Student > Lasse Madsen > H�jrupsvej 52, 2.m.f. > 9900 Frederikshavn > Denmark > >
Re: Help with adding 2 decimal numbers ! and exponents
Author: Lasse Madsen
Date: Thu, 07 Dec 2000 17:25
Date: Thu, 07 Dec 2000 17:25
78 lines
4031 bytes
4031 bytes
sorry to reply to my self twice but i have now corrected the exponent error but im still trying to figure out how i can do this : convert the "Tf.text" from "code below" into "electro" langauge 500 p (or pico) (example 12e-12 = 12p) or said in plain english to convert exponents into prefix like Kilo etc... e6 = M = mega e3 = K = kilo e-3 = m = mili e-6 = u = mirco e-9 = n = nano e-12 = p = pico Thanks once again ! "Lasse Madsen" <Lasse.Madsen@Elektronik.dk> wrote in message news:90obkt$gpj$1@news.cybercity.dk... > Thanks the adding of 2 decimal numbers now work ! ! ! > > but im still having trouble converting the numbers from the following code > into prefix > > 'Frequency = 1 / T > Text7.Text = (1 / Ttp.Text) & " Hz" > Tf.Text = Format(CDec(Text7.Text), "Scientific") > > (text7.text is an extra box which holds the code of the actual equation and > then Tf.text "should" show the PREFIX number it collected from text7.text) > > And if its possible i would like to know to to convert the "Tf.text" from > above into "electro" langauge 500 p (or pico) (example 12e-12 = 12p) > > e6 = M = mega > e3 = K = kilo > e-3 = m = mili > e-6 = u = mirco > e-9 = n = nano > e-12 = p = pico > > Thanks once again ! > > "Lasse Madsen" <Lasse.Madsen@Elektronik.dk> wrote in message > news:90mm95$7u4$1@news.cybercity.dk... > > Hi there im a 1 year electronics student in denmark which has this > problem: > > > > i have 2 values which i want to add (they are vairable) what i tourght i > > could do was > > > > text1.text = (example 0.0000004568 or 0.000000000100) > > text2.text = (same example as above) > > text3.text = result box > > as you might have figured is that im trying to add forinstance 10pico(p) > > with 1 micro(u) > > > > CODE WHICH DOESNT WORK ??? > > text3.text = Val(text1.text) + Val(text2.text) > > > > why do the above code doesnt work and what should i do ? > > and how could i make the outcome in exponent for instance if the outcome > is > > 0.0001 the it shoud read 1e-4 ??? how can i do this ? > > > > Thanks alot for your reply ! > > > > ------------------------- > > Electronics Student > > Lasse Madsen > > H�jrupsvej 52, 2.m.f. > > 9900 Frederikshavn > > Denmark > > > > > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads