Link to home
Start Free TrialLog in
Avatar of GivenRandy
GivenRandy

asked on

gcvt with VB.NET

How would I convert the C function gcvt() to VB.NET?

For example, it is something like this now:

gcvt(myDouble, 5, myString)

Where 5 is the number of digits, not necessarily the number of characters.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GivenRandy
GivenRandy

ASKER

That's not quite the equivalent and is similar to what I was already doing. I might have to settle for that at the moment. Here's a google result for gcvt():

http://www.cplusplus.com/ref/cstdlib/gcvt.html
The ToString has many different formats, and if you are looking for the exact gvct, then you could do something like this:

   gcvt (1365.249,6,buffer);  ===> ToString("N2") or ToString("####.##")

Bob