teufel
|
| Posted: 07/17/2003, 2:55 PM |
|
According to the function reference of CSS 1.0.6 at http://www.codecharge.com/studio/reference/1_0_6/ the parameters for this function are as follows:
CCFormatNumber($NumberToFormat, $FormatArray)
where
$NumberToFormat is the value to be converted, and
$FormatArray is the array of formats to be used and is as follows:
If the first element is true:
1 is there decimal separator?
2 decimal separator to use
3 is there period separator?
4 period separator to use
5 digits before decimal (array of strings: “0” or “#”)
6 digits after decimal (array of strings: “0” or “#”)
7 number multiplier
8 flag to leave value as is (true) or make it HTML safe (false)
9 HTML color to use
If the first element is false:
1 number of digits after decimal
2 include leading digit? (-1 for true, 0 for false, -2 for default)
3 use parenthesis for negative numbers (-1 for true, 0 for false, -2 for default)
4 group digits according to locale settings (-1 for true, 0 for false, -2 for default)
5 string to prepend number
6 string to append to number
7 number multiplier
8 flag to leave value as is (true) or make it HTML safe (false)
9 HTML color to use
Apparently this documentation is outdated.
Where can I find some function reference for the version 2 of CSS that describes the use of such function?
TIA,
teufel
|
|
|
 |
DaveRexel
|
| Posted: 07/17/2003, 4:05 PM |
|
Hello Teufel,
Good to hear from you again, I presume you have read the following reference,
http://docs.codecharge.com/studio/html/index.html?http:...Format.html?toc
Any chance of an upgrade of your excellent tutorial at rexdesign?
Regards
Dave
|
|
|
 |
teufel
|
| Posted: 07/22/2003, 8:45 AM |
|
Hello Dave,
Yes I got through the references made available by Yes, but they don't really have a complete function reference as they had at the following URL: http://www.codecharge.com/studio/reference/1_0_6/
My problem was due to the fact that I created a page to generate a report. After I had to almost duplicate the page to generate a very similar report and practically rewrite the code, putting many grid forms with calculated labels, etc... I saw how complicated it would be to generate reports from inside CCS, and how I would have to deal with duplicated and scattered code and have a harder time maintaining the program. I threw it all out and started from scratch by composing an external PHP class where one of the methods is responsible for composing the resulting HTML (with the help of templates as well) and then returning it to CodeCharge Studio to be printed upon a label; since I also don't know very well the inner workings of CCS's template system, I used a third party product (Smarty).
That is, in the end my report page is now composed of only the input search fields and one label where the results are to be printed. Since all the database accesses, calculations, and number formatting are being done outside CCS, I have to take care myself about all this stuff, e.g. the formatting of the numbers to be output. That's why I am using the CCFormatNumber function directly.
The code for this function can be found inside "common.php", but it is not so straightforward to understand all of its parameters. A simple function reference would suffice, but for now they still don't have all the functions inside CCS's files documented.
Here is the response I got from Yes regarding this matter: "Unfortunately we do not have detailed documentation of the function at this time. If you need to use it for the specific purpose, please provide an example of expected format and we will provide you with a function call example."
So I think we'll have to wait for a more detailed documentation, and I don't know if this is going to be soon.
Regarding my posts at Codechargers, I'll try to update things, also perhaps with comments about using this specific function. Just some questions, since I am a little confused about the changes in Codechargers: where did the knowledge base go? I could find the original text I wrote at rexdesign.com but not at codechargers.com. Also the posts previously written for phpBB apparently were not well converted to the new board used, so that posts become difficult to read.
Regards,
teufel
|
|
|
 |
DaveRexel
|
| Posted: 07/22/2003, 2:18 PM |
|
Hello Teufel,
I've had a few tussles with the CCFormatNumber function and for reports I'm looking at some OS php apps being called from CCS pages to minimise display coding.
Calculating values is not a CCS strongpoint (still no buttons for calculation functions in datasource dialog???) I admit to also sending the chosen CCS values to an interim page to do the calculations if there are many different types.
Rexdesign has been redesigned from the ground up to serve the CCS community.
The site is 100% built with current CCS version using many of the Tutorials provided. Integration with other content is explored from a CCS viewpoint.
(Free Registration Required) to encourage participation.
Regards
Dave
|
|
|
 |
|