[GNC] ANNOUNCE: GnuCash 5.10 Released

Michael or Penny Novack stepbystepfarm at comcast.net
Thu Dec 19 11:55:37 EST 2024


Description of solution:

You have strings with format  Vm.n.o  where m,n, and o are alphameric 
expressions of a number.

Convert these strings to format Vx.y.z where x, y, and z are numeric 
expressions  numbers (one byte length will be plenty if binary, two if 
BCD))

In other words, you need a function that returns the numeric value of a 
number expressed a a string of alphameric digits. Didn't have to be 
binary,  binary coded decimal also would work.

Whenever you can, break a problem into small easily tested steps. Here, 
the "guts" is to come up with a function that applied to a string which 
is the alphameric representation of a number returns a string that is a 
NUMERIC representation of that number.

'nix users  -- It's been too many years since I've looked at "the 
library of standard utilities" so for all I know, the function is 
already there. But in the spirit of the original Ritchie book (where 
exercises were writing your own version of utilities), if not, write 
such a function as an exercise.

Michael

PS: Hint needed? Again just logic/pseudocode     ---- Set num to 0; Do 
until end of string; nun = 10*num + num value of first char, string = 
rest of string




More information about the gnucash-user mailing list