2. Using VB, what is most efficient way to format this to a string so
that I can get:
0100
Examples of input and output are:
1.10 -> 0110
1.20 -> 0120
1.39 -> 0139
Here is the code I already have and it works but IMHO is a bit crude:
'sinVersion is a Single variable with the field value
String.Format( "{0:00.00}" , sinVersion ).Replace( "." , "" )
Any suggestions for optimization ?
Thanks in advance,
Louis
It looks like you are using VB.NET. This newsgroup is for VB "Classic" (VB6 and under). Please post to a newsgroup having "dotnet"
or "vsnet" in its name.
--
Mike
> Here is the code I already have and it works but IMHO is a bit crude:
>
> 'sinVersion is a Single variable with the field value
> String.Format( "{0:00.00}" , sinVersion ).Replace( "." , "" )
>
> Any suggestions for optimization ?
Replace sinVersion with (sinVersion * 100), something like this:
String.Format( "{0:0000}" , (sinVersion * 100) )
--
Money is the root of all wealth.
[.......]
> Replace sinVersion with (sinVersion * 100), something like this:
> String.Format( "{0:0000}" , (sinVersion * 100) )
>
> --
> Money is the root of all wealth.
That's brilliant!
Thanks,
Louis Ryder
> On Jan 24, 3:16 am, "Auric__" <not.my.r...@email.address> wrote:
>
>> Replace sinVersion with (sinVersion * 100), something like this:
>> String.Format( "{0:0000}" , (sinVersion * 100) )
>
> That's brilliant!
Did it work?
--
Down that path lies madness.
On the other hand, the road to hell is paved with melting snowballs.
-- Larry Wall
> On Jan 24, 3:16 am, "Auric__" <not.my.r...@email.address> wrote:
>
>> Replace sinVersion with (sinVersion * 100), something like this:
>> String.Format( "{0:0000}" , (sinVersion * 100) )
>
> On Sun, 25 Jan 2009 13:59:55 GMT, louisryder23 wrote:
>
>> On Jan 24, 3:16 am, "Auric__" <not.my.r...@email.address> wrote:
>>
>>> Replace sinVersion with (sinVersion * 100), something like this:
>>> String.Format( "{0:0000}" , (sinVersion * 100) )
>>
>> That's brilliant!
>
> Did it work?
Stupid friggin' Xnews [mumble grumble] damn double post!
--
You'd have better luck trying to artificially inseminate a brick.