CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Documentation of CCFormatNumber()

Print topic Send  topic

Author Message
dirksamson

Posts: 32
Posted: 09/19/2007, 8:02 AM

Can anyone point me to the documentation of CCFormatNumber() function (CCS3.x) ? Thanks in advance.

PS: Besides the "sec" documentation (of the parameters of the function) I'm also interested in a little more information about the #'s and 0's (etc) defining the number format.
_________________
Dirk
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/19/2007, 8:14 AM

It is in the generated COMMON,.PHP, I think.
Not at my main machine.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
dirksamson

Posts: 32
Posted: 09/19/2007, 8:35 AM

That's correct. And it handles number formatting quite nicely, respecting decimal- and thousands separators as they are set in the locales etc. So I would like to use it instead of reinventing the wheel myself. What's missing, however, is a decent documentation. For example, if you look at the (online) CCS3 documentation you will find good doc for de CCFormatDate function, but not for the CCFormatNumber function... So, where is it?
_________________
Dirk
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/19/2007, 8:38 AM

Oh ok, I get it.
I will try and find it for you, or give you a proper explanation of how to do it by analyzing the actual function in COMMON.PHP.

But, I need to get to my main machine first, which will be several hours from now.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
datadoit.com
Posted: 09/19/2007, 12:17 PM

wkempees wrote:
> Oh ok, I get it.
> I will try and find it for you, or give you a proper explanation of how to do
> it by analyzing the actual function in COMMON.PHP.
>
> But, I need to get to my main machine first, which will be several hours from
> now.
>
> Walter
> ---------------------------------------

While you're at it Walter, do the same for CCDateAdd().

:)
JimmyCrackedCorn

Posts: 583
Posted: 09/19/2007, 1:38 PM

this is great Walter. I'm going to see if I need any CCS stuff documented too! :-D
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
wkempees
Posted: 09/19/2007, 4:12 PM

@datadoit
http://forums.codecharge.com/posts.php?post_id=89929&s_keyword=ccdateadd
http://forums.codecharge.com/posts.php?post_id=89900&s_keyword=ccdateadd
http://forums.codecharge.com/posts.php?post_id=89870&s_keyword=ccdateadd
http://forums.codecharge.com/posts.php?post_id=87059&s_keyword=ccdateadd

just kidding!

@JimmyCrackedCorn
Happy to, lol
There is a Wiki docs suggestion in this forum somewhere, come on and lets
join forces.
(A per-version (not perverted) wiki would be nice)

Walter

peterr


Posts: 5971
Posted: 09/21/2007, 12:10 AM

Hi All,

Thank you for all of your time and efforts participating in the forums.
We plan to have a Wiki available by end of the year, possibly intergrated with CCS documentation and discussions, therefore please wait a little longer and we may all join forces :-)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
wkempees
Posted: 09/21/2007, 1:29 AM

Peterr
We Will! (..join forces as waiting is so much harder)
Walter

"peterr" <peterr@forum.codecharge> schreef in bericht
news:546f36e6e41cf3@news.codecharge.com...
> Hi All,
>
> Thank you for all of your time and efforts participating in the forums.
> We plan to have a Wiki available by end of the year, possibly intergrated
> with
> CCS documentation and discussions, therefore please wait a little longer
> and we
> may all join forces :-)
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

dirksamson

Posts: 32
Posted: 10/24/2007, 12:46 AM

Here's the documentation of the CCFormatNumber function; please correct me if I got it wrong:

CCFormatNumber($NumberToFormat, $FormatArray, $DataType, $isDBFormat)

$NumberToFormat
The number to format. In PHP this may in fact be a string, just make sure the decimal separator is a ‘.’ and not a comma.

$FormatArray
0 boolean ExtendedFormat
Simple || Extended
1 AfterDecimal || unused; see arg 6
2 decimal separator * || idem
3 period separator || idem
4 hide minus sign (if the number is neg)** || idem
5 prepend to resulting formatted number || BeforeDecimal. ***
6 append to resulting formatted number || AfterDecimal ***
7 multiplier (use 1; this is not a default!) || idem
8 apply CCToHTML() || idem
9 color **** || idem

* Defaults to setting defined in $CCSLocales
** The minus sign will be the first character in the formatted number
*** in the array, use ‘0’ for obligatory positions, ‘#’ for optional positions. All other strings will de displayed ‘as is’.
**** in fact a <span style=’’> ($CCSIsXHTML) or [deprecated!] <font color=’’> tag is placed around the result.

$DataType
Only used if FormatArray[6] (extendedFormat) or FormatArray[1] (simpleFormat) isn’t set (== null). If this argument is set to ccsInteger, the number of decimals will be 0, otherwise it will be set to 100 if $isDbFormat or the number of decimal digits defined in $CCSLocales. (note to the programmer: nested "() ? : ;" constructs do not make very readable code!)

$isDBFormat
See $DataType
_________________
Dirk
View profile  Send private message
wkempees
Posted: 10/24/2007, 4:04 AM

Thanks.

"dirksamson" <dirksamson@forum.codecharge> schreef in bericht
news:5471ef8590b56f@news.codecharge.com...
> Here's the documentation of the CCFormatNumber function; please correct me
> if I
> got it wrong:
>
> CCFormatNumber($NumberToFormat, $FormatArray, $DataType, $isDBFormat)
>
> $NumberToFormat
> The number to format. In PHP this may in fact be a string, just make sure
> the
> decimal separator is a '.' and not a comma.
>
> $FormatArray
> 0 boolean ExtendedFormat
> Simple || Extended
> 1 AfterDecimal || unused; see arg 6
> 2 decimal separator * || idem
> 3 period separator || idem
> 4 hide minus sign (if the number is neg)** || idem
> 5 prepend to resulting formatted number || BeforeDecimal. ***
> 6 append to resulting formatted number || AfterDecimal ***
> 7 multiplier (use 1; this is not a default!) || idem
> 8 apply CCToHTML() || idem
> 9 color **** || idem
>
> * Defaults to setting defined in $CCSLocales
> ** The minus sign will be the first character in the formatted number
> *** in the array, use '0' for obligatory positions, '#' for optional
> positions.
> All other strings will de displayed 'as is'. TIP: you can insert a string
> only
> for positive/negative numbers using (IsNegative ? '-' : ''); e.g. to put a
> minus
> sign between the currency sign and the amount instead of before the entire
> string. If you do this, set arg[4] = true to prevent double minus signs.
> **** in fact a <span style=''> ($CCSIsXHTML) or [deprecated!] <font
> color=''>
> tag is placed around the result.
>
> $DataType
> Only used if FormatArray[6] (extendedFormat) or FormatArray[1]
> (simpleFormat)
> isn't set (== null). If this argument is set to ccsInteger, the number of
> decimals will be 0, otherwise it will be set to 100 if $isDbFormat or the
> number
> of decimal digits defined in $CCSLocales. (note to the programmer: nested
> "() ?
> : ;" constructs do not make very readable code!)
>
> $isDBFormat
> See $DataType
> _________________
> Dirk
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.