Revision 623121

Go back to digest for 21st January 2007

Features in Office

Brad Hards committed changes in /trunk/koffice/kspread:

More work on OpenFormula function compliance.

This change updates the following functions:
BIN2OCT, BIN2HEX, DEC2HEX, DEC2BIN, DEC2OCT, HEX2BIN, HEX2OCT, OCT2BIN, OCT2DEC, OCT2HEX.

The changes are mostly to support an optional extra argument which specifies a minimum length of the output string. We also now throw an error if there is an illegal character in the input (e.g. binary input, but something other than a 0 or 1) - previously we just returned zero.

We still don't handle negative numbers correctly for these functions.

This change also modifies the behaviour of BASE in a subtle and possibly dangerous way - the optional third argument is no longer precision (i.e. number of characters after the decimal point), it is now minimum length (i.e. total number of characters). This is the way it is supposed to work according to the OpenFormula spec (section 6.17.3).

It also adds a new function - DECIMAL, which basically turns a text string in any base into a number in base 10 (roughly the reverse of the BASE function). This works in accordance with the OpenFormula spec.

File Changes

Modified 4 files
  • /trunk/koffice/kspread
  •   /ValueCalc.cpp
  •   /ValueCalc.h
  •   /functions/engineering.cpp
  •   /functions/engineering.xml
4 files changed in total