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
Medium Priority
245 Views
I want to convert below Java script expression to VB 6.0:

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

dec = 3799
logx = 3)

I want equivalent in VB 6.0 ?

Thanks
0
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
• 3
• 2

LVL 12

Expert Comment

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

ID: 39777696
Thanks

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

LVL 12

Accepted Solution

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

ID: 39777990
Thanks

We are calculating density/ viscosity etc...
0

LVL 8

Author Closing Comment

ID: 39780696
Thanks
0

## Featured Post

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
Course of the Month4 days, 8 hours left to enroll