https://bugs.documentfoundation.org/show_bug.cgi?id=150923

Mike Kaganski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #2 from Mike Kaganski <[email protected]> ---
This is not a bug.

First of all: what is your expectation using the "TEXT(DEC2HEX)"? The TEXT(...,
"#") function formats the passed number according to the numeric format string;
while DEC2HEX creates a *string* representing the number in hexadecimal form.
So this combination:

=TEXT(DEC2HEX(<number>);"#")

first converts <number> to a string, and then tries to interpret the string as
a number, to be converted to another string again.

Now to the conversion of strings to numbers: any user input is attempted to be
treated as a *decimal* number. So, 2E99 is treated as a decimal number in
exponential (E) notation = 2 * 10 ^ 99 [1].

So:

1. Hexadecimal string "1" treated as decimal, converts to number 1, and then
output as "1";
2. Hexadecimal string "10" (with value of sixteen) is treated as decimal,
converts to number10 (ten!), and output as "10", but it just coincides with
what you expect;
2. Hexadecimal string "2E99" treated as decimal, converts to 2 * 10 ^ 99, and
output as
"2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
3. Hexadecimal string "1EA" cannot be interpreted as a number in any known
format, and is treated as *string*, so output unmodified as "1EA".

Closing NOTABUG. Use DEC2HEX by its own, without TEXT.

[1] https://en.wikipedia.org/wiki/Scientific_notation#E_notation

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to