Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

convert Javascript to VB 6

Posted on 2014-01-13
5
Medium Priority
?
245 Views
Last Modified: 2014-01-14
I want to convert below Java script expression to VB 6.0:

return lead + "." +  dec + "E" +  logX;


(lead = 86
dec = 3799
logx = 3)



I want equivalent in VB 6.0 ?



Thanks
0
Comment
Question by:mani_sai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:HugoHiasl
ID: 39777691
The expression would be

CStr(lead) &  "." & CStr(dec) & "E" & CStr(logX)


If it is with in a function then you need to assign this value to the name of the function

function test  as string
  test  = CStr(lead) &  "." & CStr(dec) & "E" & CStr(logX)
end function
0
 
LVL 8

Author Comment

by:mani_sai
ID: 39777696
Thanks

My function is returning back as double...  Can we convert the output to double?
0
 
LVL 12

Accepted Solution

by:
HugoHiasl earned 2000 total points
ID: 39777977
I assume it is a geographical information. Then it is wrong built.

86.3799 would be a valid value...

86.3799E3 would convert to 86379.9  as double. This is not a valid value

DIM myString
DIM myValue as Double

myString = CStr(lead) & "." & CStr(dec)

myValue = CDbl(myString)
myValue = myValue * (10^logX)

Now myValue should have a valid value. EXXX in a scientfic notation is doing nothing else than shifting the decimal point.
0
 
LVL 8

Author Comment

by:mani_sai
ID: 39777990
Thanks

We are calculating density/ viscosity etc...
0
 
LVL 8

Author Closing Comment

by:mani_sai
ID: 39780696
Thanks
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Progress
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question