Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] format does not work correctly for large Int64's (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] [ANN] 13.1pr15
Next thread: [MBS] Open polygons


Re: [MBS] Popupmenu   -   Garth Hjelte
  [MBS] format does not work correctly for large Int64's   -   Peter K. Stys
   Re: [MBS] format does not work correctly for large Int64's   -   Peter K. Stys
   Re: [MBS] format does not work correctly for large Int64's   -   Christian Schmitz
   Re: [MBS] format does not work correctly for large Int64's   -   Christian Schmitz
   [MBS] Re: format does not work correctly for large Int64's   -   Peter K. Stys
   [MBS] Re: format does not work correctly for large Int64's   -   Peter K. Stys

[MBS] format does not work correctly for large Int64's
Date: 19.04.13 07:02 (Fri, 19 Apr 2013 00:02:25 -0600)
From: Peter K. Stys
try this:

dim i as Int64 = 23897188192681986
dim s1 as String = str(i)
dim s2 as String = format(i, "-#")

s1 is correct, s2 is wrong, amazingly

This is very bad.

RS, pls fix such basic things.

p.

...and no, I will not file a feedback report because every time I try it
tells me I need an update then the update fails.

So this is my feedback report.

Re: [MBS] format does not work correctly for large Int64's
Date: 19.04.13 07:39 (Fri, 19 Apr 2013 00:39:58 -0600)
From: Peter K. Stys
On Fri, Apr 19, 2013 at 12:30 AM, Christian Schmitz <
<email address removed>> wrote:

>
> You posted to the MBS List…
>
sorry, late nite

-

Re: [MBS] format does not work correctly for large Int64's
Date: 19.04.13 07:31 (Fri, 19 Apr 2013 08:31:21 +0200)
From: Christian Schmitz

Am 19.04.2013 um 08:26 schrieb Peter K. Stys <<email address removed>>:

> i suppose this has to do with Int64 to double conversion and loss of
> precision. If str does it (with the optional format string), what's the
> point of the format() fn if one may get incorrect results?

str takes variant and simply calls stringvalue on Int64 in variant which gives right value.

RS could overload Format function to Int64.

Greetings
Christian

Re: [MBS] format does not work correctly for large Int64's
Date: 19.04.13 07:30 (Fri, 19 Apr 2013 08:30:13 +0200)
From: Christian Schmitz

Am 19.04.2013 um 08:02 schrieb Peter K. Stys <<email address removed>>:

> try this:
>
> dim i as Int64 = 23897188192681986
> dim s1 as String = str(i)
> dim s2 as String = format(i, "-#")
>
> s1 is correct, s2 is wrong, amazingly

format takes double which has limited precision.

>
> ...and no, I will not file a feedback report because every time I try it
> tells me I need an update then the update fails.
>

You posted to the MBS List…

it's feedback case 15962
<feedback://showreport?report_id=15962>

Greetings
Christian

-

[MBS] Re: format does not work correctly for large Int64's
Date: 19.04.13 07:29 (Fri, 19 Apr 2013 00:29:02 -0600)
From: Peter K. Stys
my final post on this for tonite:

dim u as UInt64 = 23897188192681986
s2 = str(u, "#")
s1 = str(u)

guess what?


On Fri, Apr 19, 2013 at 12:26 AM, Peter K. Stys <<email address removed>> wrote:

> i suppose this has to do with Int64 to double conversion and loss of
> precision. If str does it (with the optional format string), what's the
> point of the format() fn if one may get incorrect results?
>
> On Fri, Apr 19, 2013 at 12:02 AM, Peter K. Stys <<email address removed>> wrote:
>
>> try this:
>>
>> dim i as Int64 = 23897188192681986
>> dim s1 as String = str(i)
>> dim s2 as String = format(i, "-#")
>>
>> s1 is correct, s2 is wrong, amazingly
>>
>> This is very bad.
>>
>> RS, pls fix such basic things.
>>
>> p.
>>
>> ...and no, I will not file a feedback report because every time I try it
>> tells me I need an update then the update fails.
>>
>> So this is my feedback report.
>>
>> --
>> ---------------------------------------------
>> Peter K. Stys, MD
>> Dept. of Clinical Neurosciences
>> Hotchkiss Brain Institute
>> University of Calgary
>> tel (403) 210-8646
>> ---------------------------------------------
>>
> --
> ---------------------------------------------
> Peter K. Stys, MD
> Dept. of Clinical Neurosciences
> Hotchkiss Brain Institute
> University of Calgary
> tel (403) 210-8646
> ---------------------------------------------
>

[MBS] Re: format does not work correctly for large Int64's
Date: 19.04.13 07:26 (Fri, 19 Apr 2013 00:26:37 -0600)
From: Peter K. Stys
i suppose this has to do with Int64 to double conversion and loss of
precision. If str does it (with the optional format string), what's the
point of the format() fn if one may get incorrect results?

On Fri, Apr 19, 2013 at 12:02 AM, Peter K. Stys <<email address removed>> wrote:

> try this:
>
> dim i as Int64 = 23897188192681986
> dim s1 as String = str(i)
> dim s2 as String = format(i, "-#")
>
> s1 is correct, s2 is wrong, amazingly
>
> This is very bad.
>
> RS, pls fix such basic things.
>
> p.
>
> ...and no, I will not file a feedback report because every time I try it
> tells me I need an update then the update fails.
>
> So this is my feedback report.
>
> --
> ---------------------------------------------
> Peter K. Stys, MD
> Dept. of Clinical Neurosciences
> Hotchkiss Brain Institute
> University of Calgary
> tel (403) 210-8646
> ---------------------------------------------
>