LC converts phone number to scientific notation
Klaus major-k
klaus at major-k.de
Fri Sep 9 06:40:12 EDT 2022
Hi Panos,
> Am 09.09.2022 um 12:27 schrieb panagiotis m via use-livecode <use-livecode at lists.runrev.com>:
>
> Hello Klaus,
>
> I guess what happens here is that if you fetch item X of line Y and use it
> directly, LC treats it as a number and displays it in scientific notation.
obviously!
> On the contrary, if you first put item X of line Y into a variable, then
> the variable is treated as text, so it is not converted.
Yo, that's why my workaround erm. works. :-)
Thank you for the explanation!
> Kind regards,
> Panos
> --
>
> On Fri, 9 Sept 2022 at 13:01, Klaus major-k via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> Hi friends,
>>
>> I have a very strange problem, but also found a workaround for it.
>>
>> I first convert an 8 MB CSV file with 60000 lines to TAB delimited data,
>> then I parse the file
>> and just extract some columns from the 60000 lines to display in a field.
>> E.g. the column "number dialled", which contains phone number like
>> -> 447973100123
>>
>> The CSV files are definitively correct but I found that in the resulting
>> field some of these numbers
>> appear in scientific notation
>> -> 4.47888E+11
>>
>> This does not happen with phone numbers with a leading ZERO: like
>> -> 07557162491
>> So maybe this a small hint?
>>
>> However I do not even touch these items I just use:
>> ...
>> put item 9 of tLine into item 6 of tNewLine
>> ## tLine is the line from the CSV and tNewLine is for the data in the
>> display field.
>> ...
>>
>> My simple workaround, no idea why, but it obviously works:
>> ...
>> put item 9 of tLine into ttt
>> put ttt into item 6 of tNewLine
>> ...
>> This avoids the scientific notation, what the hell is going on here?
>> Any hints welcome.
>
Best
Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
klaus at major-k.de
More information about the use-livecode
mailing list