Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Implementing A Binary, hex, oct, etc. cell number format | ||
---|---|---|---|
Product: | Calc | Reporter: | smerkley <srmerkley> |
Component: | formatting | Assignee: | AOO issues mailing list <issues> |
Status: | ACCEPTED --- | QA Contact: | |
Severity: | Trivial | ||
Priority: | P5 (lowest) | CC: | issues |
Version: | OOo 3.3 | Keywords: | rfe_eval_ok |
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
smerkley
2003-08-11 15:20:33 UTC
Hi Bettina, 1 4 u. As we have functions to change e.g. a decimal to a hex number and vice versa I think this is not of a high priority. Frank set the target Summary:Proposed is adding number format for cells that would allow the user to select(for instance) a hex format for a cell and then be able to enter in a hex numberi.e. "FACE" and then be able to do calculations, lists, etc. on it just as you would a decimal number. Considered for Office later, changed priority. I would like an 'IP Address' number format. This can be stored internally as a regular number (as I believe dates are) but displayed and entered as an ip address (10.1.1.45) Here is some sample C++ that does the conversions #include <iostream> #include <string> using namespace std; int main() { unsigned long number = 0; int tmp = 0, dots = 0; string ip; /* Parse IP Address * Algorithm summary: * * Browse over each character in the input. * Build a number until a dot is encountered or the number goes out of range. * Repeat until end of string * If an invalid character is found, bail out. */ cin >> ip; for (int i = 0, j = ip.length(); i < j; i++) { // cout << i << ": " << ip[i] << endl; if (ip[i] >= '0' && ip[i] <= '9') { tmp = tmp * 10 + (ip[i] - '0'); if (tmp > 255) { cout << "parse error: value out of range\n"; return 3; } // cout << "tmp: " << tmp << endl; continue; } if (ip[i] == '.') { number *= 256; number += tmp; tmp = 0; dots++; // cout << "number; " << number << endl; continue; } cout << "parse error on character " << i << "\n"; return 1; } if (dots != 3) { cout << "parse error: incorrect format\n"; return 2; } number *= 256; number += tmp; tmp = 0; cout << number << endl; /* Format IP Address * Algorithm summary: * * Extract each portion of the number and display. * * I think there may be a better way to do this by shifting bits then mod 256 */ // cin >> number; tmp = (number - (number % 16777216)) / 16777216; cout << tmp << "."; number %= 16777216; tmp = (number - (number % 65536)) / 65536; cout << tmp << "."; number %= 65536; tmp = (number - (number % 256)) / 256; cout << tmp << "."; number %= 256; cout << number << endl; return 0; } I'm not sure if this is closely related enough to this issue or not. Should I file a new issue specific to ip addresses? *** Issue 80985 has been marked as a duplicate of this issue. *** Is anything being done on this? Someone set the status to "Started" but then the milestone is simply "OOo Later". I realize that it's not high priority, but for those of us that use other numbering systems than decimal it would be very nice. Even if it was a case of having to hard set each cell to the numbering system desired it would still be very beneficial. Thanks. Sorry, I didn't mean to raise the priority level. (Not that I don't want it to be, but I know it's low priority for most people) Just checked this in OOo 3.0 (OOO300m9) Still would be nice to have. To grep the issues easier via "requirements" I put the issues currently lying on my owner to the owner "requirements". Just noting that it still isn't implemented in version 3.3. It seems to me this could be a cool feature that shouldn't be so hard to implement. I mean aren't these formats more like what computers use anyway? |