[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53000] Variable editor: Value of '0' is not a
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #53000] Variable editor: Value of '0' is not aligned correctly |
Date: |
Fri, 2 Feb 2018 14:46:57 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #14, bug #53000 (project octave):
There may be a spread-sheet-like interpretation of the entered string. It's
clear there is a difference. Try the following:
>> z_cell_mix = {"0";1}
z_cell_mix =
{
[1,1] = 0
[2,1] = 1
}
>> openvar z_cell_mix
(Note how the above variable print-out has strings left-aligned, numbers
right-aligned.) Now experiment with entering in these entries something like
"001.2300" in these cells. For the numeric cell, the 00 is dropped.
Then again, a similar thing happens when I do so at the command line:
>> z_cell_mix{2,1} = 001.2300
z_cell_mix =
{
[1,1] = 001.2300
[2,1] = 1.23
}
But maybe cells are different from arrays within Octave core too:
>> x = [1; 1]
x =
1
1
>> x(2)
ans = 1
>> x(2) = 1.23
x =
1.0000
1.2300
>> x(2)
ans = 1.2300
Perhaps there is a special table member function which sets the table cell
entry to be a string even if the ASCII translates to a valid string. Or
experiment with tacking an apostrophe to the front of what is passed to the Qt
table, as I know in spreadsheets entering something like '0123 (only
apostrophe at front) will interpret the contents as a string rather than
numeric.
This could explain the left-aligned "0" and possibly why I was seeing the
initial left-aligned numbers suddenly jump to right aligned. I'm not sure
how, but I would guess it can be a confusing lost-in-translation kind of
thing.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53000>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/