Issue 126746 - Mid only calculates whole numbers
Summary: Mid only calculates whole numbers
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: 4.1.2
Hardware: PC Windows 10
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2015-12-20 15:43 UTC by M.A. Tempinski
Modified: 2015-12-23 09:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description M.A. Tempinski 2015-12-20 15:43:26 UTC
=MID("0230";2;2)/10     will produce 2.3
=MID("023.00";2;4)/10   will produce #VALUE!

Conversions are made for whole numbers.

I noticed, in other issue reports, that the reason that this type of error was 'not an issue' was because the mid function returns only text, but the example above shows that the mid function does have the ability to do a conversion 

Wrapping the mid function with the VALUE function will correct the second situation
Comment 1 bmarcelly 2015-12-23 09:49:44 UTC
It is not a problem of MID() function. You have the same problem with
="123"/10    OK
="123.4"/10  #VALUE!

The reason is that converting a string containing an Integer is not ambiguous. Converting a string containing a dot or a comma is ambiguous since its interpretation depends on the locale of the user.
Having such formulas is incorrect.

Conclusion : not an issue.