Thread: itoas() gets full optionals

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    182

    itoas() gets full optionals

    During the first stage ===> Look Here
    We looked for a standard function to format integer numbers with thousand
    separators. We were not able to find anything useful, so we started building it.
    After some experimentation we got some working functions.

    During the second stage ===> Look Here
    We tested the functions to be sure they were doing what expected.
    Now we have almost finished the testing process, we just need some more test
    and we are done.

    At this development stage we could ask ourselves if the function we built
    is doing all the needed things, or we have to add some new features.

    We have also some more points to cover before we can consider the job done:

    - how are we going to use it?
    - does it need an header file?
    - will it be inside a user library?
    - have we to add some more comments about the algorithm we used?
    - what parameters should the caller use to have different separators?
    - and so on

    I'm not used to work with these steps so any help is very welcome.

  2. #2
    Registered User
    Join Date
    Jun 2010
    Posts
    182
    The first and probably easiest thing to add to itoas() is the
    choice of the separator to use when the function is called. So in a free
    short time I coded it.

    Now itoas() is at version 0.8, almost ready for going into one's library.

    I've still the final test to perform, and it is almost ready as well.

    Attached the new release with the new feature.

    Enjoy

  3. #3
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    >> - how are we going to use it?

    I'm not, but apparently you are. The answer to this is the answer to another question, where do you need formatted numbers? This could mean that another language or API has to call your function, so how does that work? Would it be easier to reimplement this if need be?

    >> - does it need an header file?

    Where do you need formatted numbers?

    >> - will it be inside a user library?

    Where do you need formatted numbers?

    >> - have we to add some more comments about the algorithm we used?

    Is the algorithm well-documented, so that we know how what the function does, how the function fails to work, or under what circumstances things go wrong? Take a look at the man page for any standard function. Such implementations have been tested enough that they all fail to work in the exact same way under well-understood conditions.

    >> - what parameters should the caller use to have different separators?

    What has been done before? Why does it work? Think locale.h

    >> - and so on

    And so forth.

  4. #4
    Registered User
    Join Date
    Jun 2010
    Posts
    182
    @whiteflag:

    I was always quite busy in the last 30 years, so I did not get time enough
    to start studying C. Now I'm not in a hurry anymore, and although not used
    to coding anymore, I decided to begin the learning path.

    Am I going to use it? Maybe. What I'm interested more is the fact that if I need
    it, it is there to be used, and moreover what I learn during the path. Others can
    use it or study it, I hope at least.

    I'm going to enjoy the remaining path as well, no matter what. When you are
    free and available to enjoy some free coding, join the path, by all means.

    Have a nice time

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    182
    Version 0.8 is ready: ===> Look Here.

    It is full tested and has got the possibility to choose the thousand separator.

    From now on, only customized new versions or "windows only" could follow.

    Enjoy

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to find out if a string is full?
    By Tiago in forum C Programming
    Replies: 8
    Last Post: 05-25-2010, 01:27 PM
  2. Counting days
    By TheShaggmeister in forum C++ Programming
    Replies: 5
    Last Post: 07-17-2003, 10:29 AM
  3. hashing help
    By alokin in forum C Programming
    Replies: 17
    Last Post: 10-28-2002, 06:33 PM
  4. Running in full screen mode!
    By Skute in forum Game Programming
    Replies: 0
    Last Post: 12-10-2001, 03:56 AM