Professional Web Applications Themes

[PHP] Changing numbers - PHP Development

What about if I had 2.856 that function will make it 2.86. "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message news:C8F323573C030A448F3E5A2B6FE2070B0101F95Aneme sis... [snip] How can I make them have at least 2 decimal places? [/snip] RTFM at [url]http://www.php.net/number_format[/url] HTH!...

  1. #1

    Default Re: [PHP] Changing numbers

    What about if I had 2.856 that function will make it 2.86.


    "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    news:C8F323573C030A448F3E5A2B6FE2070B0101F95Aneme sis...
    [snip]
    How can I make them have at least 2 decimal places?
    [/snip]

    RTFM at [url]http://www.php.net/number_format[/url]

    HTH!


    Zavaboy Guest

  2. #2

    Default Re: [PHP] Changing numbers

    try rounding it first

    [url]http://www.php.net/manual/en/function.round.php[/url]

    Zavaboy wrote:
    > What about if I had 2.856 that function will make it 2.86.
    >
    >
    > "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    > news:C8F323573C030A448F3E5A2B6FE2070B0101F95Aneme sis...
    > [snip]
    > How can I make them have at least 2 decimal places?
    > [/snip]
    >
    > RTFM at [url]http://www.php.net/number_format[/url]
    >
    > HTH!
    >
    >
    James Rodenkirch Guest

  3. #3

    Default Re: [PHP] Changing numbers

    *Sigh*, lets say I have:

    2.65
    3.3
    5.2670
    12.030

    I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
    5.27:

    2.65
    3.30
    5.267
    12.03

    "James Rodenkirch" <jamesrez-net.com> wrote in message
    news:3F1C298E.80602ez-net.com...
    > try rounding it first
    >
    > [url]http://www.php.net/manual/en/function.round.php[/url]
    >
    > Zavaboy wrote:
    >
    > > What about if I had 2.856 that function will make it 2.86.
    > >
    > >
    > > "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    > > news:C8F323573C030A448F3E5A2B6FE2070B0101F95Aneme sis...
    > > [snip]
    > > How can I make them have at least 2 decimal places?
    > > [/snip]
    > >
    > > RTFM at [url]http://www.php.net/number_format[/url]
    > >
    > > HTH!
    > >
    > >
    >

    Zavaboy Guest

  4. #4

    Default RE: [PHP] Changing numbers

    [snip]
    I would like it at least 2 decimal places.. So, 5.2670 would be 5.267
    not
    5.27:
    [/snip]

    RTFM for formatted string [url]http://us3.php.net/sprintf[/url] or
    [url]http://us3.php.net/printf[/url]

    HTH
    Jay Blanchard Guest

  5. #5

    Default Re: [PHP] Changing numbers

    On Tue, 22 Jul 2003 04:03, zavaboy wrote:
    > *Sigh*, lets say I have:
    >
    > 2.65
    > 3.3
    > 5.2670
    > 12.030
    >
    > I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
    > 5.27:
    >
    5.267 is 3 decimal places - count them
    Bob Parker Guest

  6. #6

    Default Re: [PHP] Changing numbers

    zavaboy wrote:
    > *Sigh*, lets say I have:
    >
    > 2.65
    > 3.3
    > 5.2670
    > 12.030
    >
    > I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
    > 5.27:
    >
    > 2.65
    > 3.30
    > 5.267
    > 12.03
    >
    > "James Rodenkirch" <jamesrez-net.com> wrote in message
    > news:3F1C298E.80602ez-net.com...
    >
    >>try rounding it first
    >>
    >>[url]http://www.php.net/manual/en/function.round.php[/url]
    >>
    >>Zavaboy wrote:
    >>
    >>
    >>>What about if I had 2.856 that function will make it 2.86.
    >>>
    >>>
    >>>"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    >>>news:C8F323573C030A448F3E5A2B6FE2070B0101F95An emesis...
    >>>[snip]
    >>>How can I make them have at least 2 decimal places?
    >>>[/snip]
    >>>
    >>>RTFM at [url]http://www.php.net/number_format[/url]
    >>>
    >>>HTH!
    >>>
    >>>
    >>
    >
    *Sigh*

    RTFM - [url]http://us4.php.net/sprintf[/url]

    John Nichel Guest

  7. #7

    Default Re: [PHP] Changing numbers

    bob parker wrote:
    > On Tue, 22 Jul 2003 04:03, zavaboy wrote:
    >
    >>*Sigh*, lets say I have:
    >>
    >>2.65
    >>3.3
    >>5.2670
    >>12.030
    >>
    >>I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
    >>5.27:
    >>
    >
    >
    > 5.267 is 3 decimal places - count them
    >
    He said "at least 2 decimal places", not "exactally two decimal places".

    John Nichel Guest

Similar Threads

  1. Changing text without changing frames.
    By Jose Olivas in forum Macromedia Flash
    Replies: 1
    Last Post: March 21st, 11:36 AM
  2. Changing numbers
    By Zavaboy in forum PHP Development
    Replies: 5
    Last Post: July 21st, 09:45 PM
  3. IP numbers
    By Val in forum Windows Setup, Administration & Security
    Replies: 2
    Last Post: July 11th, 04:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139