Page 1 of 1

ticklish format

Posted: Tue Jun 11, 2019 9:50 pm
by dunbarx
Why when I put the ticks into a variable, I get it in scientific notation, whereas if I just ask for the ticks, I get an integer.

I am in v.9.04. I do not remember this ever happening in earlier versions. I can convert using the "format" function, but what is the scoop?

Craig

Re: ticklish format

Posted: Tue Jun 11, 2019 10:16 pm
by bogs
dunbarx wrote:
Tue Jun 11, 2019 9:50 pm
I am in v.9.04. I do not remember this ever happening in earlier versions.
Me either :shock:
Selection_001.png
Tick tick tick...
Selection_001.png (11.02 KiB) Viewed 815 times

Re: ticklish format

Posted: Tue Jun 11, 2019 10:43 pm
by dunbarx
Bogs.

AH HAHAHAHAHA. You kill me.

Try this:

Code: Select all

on mouseUp
   breakpoint
   put the ticks
   put the ticks into temp
   put  format("%0.f",temp) into temp
end mouseUp
Craig

Re: ticklish format

Posted: Tue Jun 11, 2019 10:44 pm
by dunbarx
HAHAHA. Still giggling

Let me catch my breath.

It also applies to "the seconds".

I don't see a preference that formats numbers in the SE.

Craig

Re: ticklish format

Posted: Wed Jun 12, 2019 7:13 am
by bogs
dunbarx wrote:
Tue Jun 11, 2019 9:50 pm
Why when I put the ticks into a variable, I get it in scientific notation, whereas if I just ask for the ticks, I get an integer.
Glad you got a chuckle from my following of your formula, even if I'm not sure why :D
dunbarx wrote:
Tue Jun 11, 2019 10:43 pm
Try this:
Ok...
Selection_001.png
And now for something completely different...

Re: ticklish format

Posted: Wed Jun 12, 2019 11:51 am
by Klaus
Variable or not, I get the correct integer, too.
macOS 10.14.5, LC 9.04 Indy

Re: ticklish format

Posted: Wed Jun 12, 2019 3:14 pm
by dunbarx
I don't, sort of. In a button script:

Code: Select all

on mouseUp
   breakpoint
   put the ticks  into temp -- temp is in sci. notatation ("9.36209E+10")
   put the seconds  into temp  -- temp is in sci. notatation
   put the ticks  && the seconds into temp  -- temp is two integers
end mouseUp
I get scientific notation in the variable pane for each of the first two "put" lines. If I open either of those variables by double clicking the variable name, the small window shows an integer. So scientific notation in the variable pane of the SE, but an integer if I open the variable up for inspection

The third line, concatenating the two functions, shows integers all around.

A small thing, likely a tiny bug, but I wasted a lot of time on it. If nobody else has seen this, I am not sure it is worth reporting.

Craig

Re: ticklish format

Posted: Wed Jun 12, 2019 3:59 pm
by bogs
dunbarx wrote:
Wed Jun 12, 2019 3:14 pm
If nobody else has seen this, I am not sure it is worth reporting.
Well, I'm not sure I count in that 'seeing' it stuff, after all I'm ...
* on linux and...
* don't venture past 6.x, and...
* haven't gotten any version of Lc past 8.0.1 to run on my distro of choice reliably to do any serious testing.

To test for stuff in the newer versions, I have to launch a VM and on my incredibly underwhelming system that is something I only do when I have *lots* of spare time on my hands.

I vote for you to report it :P

Re: ticklish format

Posted: Thu Jun 13, 2019 5:17 pm
by jacque
This sounds like the automatic typing the engine does so that we don't have to declare typed variables. The engine is treating the data as a float until it is transformed to text. This is what numberformat does too and the data has to be put in a field or treated in a script as text before it displays as text. In your example, comcatenating the ticks and the seconds transforms it to a text string.

Re: ticklish format

Posted: Thu Jun 13, 2019 5:53 pm
by dunbarx
Jacque.

I get that, which is why for decades I have always added a "0" to any value after changing the numberFormat.

But as usual I am the only one seeing this. And it is a small thing, after all; LC is perfectly capable of using scientific format for all its needs (and mine) that incorporate these two functions.

It's just that, well, why me?

Craig

Re: ticklish format

Posted: Thu Jun 13, 2019 6:12 pm
by jacque
It's not just you, I see it in the variable watcher frequently. It just never bothered me and didn't interfere with the scripts.