ticklish format
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
ticklish format
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: ticklish format
Bogs.
AH HAHAHAHAHA. You kill me.
Try this:
Craig
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
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: ticklish format
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
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
Glad you got a chuckle from my following of your formula, even if I'm not sure why
Ok...
Re: ticklish format
Variable or not, I get the correct integer, too.
macOS 10.14.5, LC 9.04 Indy
macOS 10.14.5, LC 9.04 Indy
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: ticklish format
I don't, sort of. In a button script:
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
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
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
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
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: ticklish format
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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: ticklish format
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
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
-
- VIP Livecode Opensource Backer
- Posts: 7228
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: ticklish format
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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com