Forum OpenACS Development: lc_numeric - Behavior with empty string instead of number


lc_numeric is used to format numbers according to locale. It works very well in general.

However, when used to format SQL query output, there is frequently the case that the SQL returns an empty string instead of a number.

Currently, lc_numeric creates a hard error in this case.

I'm normally a big fan of "hard errors", because they can reveal issues in the general logic etc.

However, I would argue that there is nothing bad with an NULL value returned by a SQL statement.

So we are going to modify lc_numeric for ]po[ with a simple statement to return an empty string if the argument is an empty string.

It would be great if somebody (Gustaf? :-) could include this in the OpenACS core.


What is the exact issue? The following call

  lc_numeric ""

works fine in current OpenACS. Was the the improvement, you want to achieve, already implemented, or did is misread your posting?