Formatting decimal places

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Julie

    #16
    Re: Formatting decimal places

    David Harmon wrote:[color=blue]
    >
    > On Tue, 20 Apr 2004 10:41:14 -0700 in comp.lang.c++, Julie
    > <julie@nospam.c om> wrote,[color=green]
    > >[color=darkred]
    > >> I was expressing (rather tersely) that a reference to Boost is off-topic in
    > >> this forum when there is an existing and preferred solution in C++ language.[/color][/color]
    >
    > Boost is a collection of solutions in the C++ language.[/color]

    True.
    [color=blue]
    > Widely accepted and frequently preferred.[/color]

    I don't know if that is true or not, regardless, that doesn't make it on
    topic. There are plenty of other libraries out there that are equally widely
    accepted and preferred, but are off topic. I'm not saying that Boost, per se,
    is on or off topic, just saying that universal acceptance doesn't equate to on
    topic.
    [color=blue]
    > Not in any way off-topic that I can see.[/color]

    As I said, it is off topic because there is a perfectly suitable C++ language
    solution. If there were no C++ solution, then the Boost response may have been
    appropriate and on-topic.
    [color=blue]
    > It does happen to be the wrong answer to the question of this thread,
    > but that's a different matter entirely.[/color]

    No, it wasn't a different matter, but entirely _the_ matter of discussion.

    I know that this discussion is getting close to splitting hairs that no one
    really cares about, including me, so I don't really have much more to add to
    this or any other response.

    Comment

    • Julie

      #17
      Re: Formatting decimal places

      Jeff Schwab wrote:[color=blue]
      >
      > Julie wrote:[color=green]
      > > David Harmon wrote:
      > >[color=darkred]
      > >>On Tue, 20 Apr 2004 08:45:50 -0700 in comp.lang.c++, Julie
      > >><julie@nospam .com> wrote,
      > >>
      > >>>Marcin Kalicinski wrote:
      > >>>
      > >>>>Uzytkowni k "Andrew" <admckni@hqcnsg .navy.mil> napisal w wiadomosci
      > >>>>news:8e7fb0 4b.0404200701.7 8f638bb@posting .google.com...
      > >>>>
      > >>>>>I trying to format my output to display a set number of decimal
      > >>>>>places. I have been trying to use the <iomanip> setprecision(), but
      > >>>>>that will only display the total number of digits. Can someone please
      > >>>>>help me???? Thanks.
      > >>>>
      > >>>>Check out boost::format.
      > >>>>
      > >>>>Marcin
      > >>>
      > >>>Boost is OT in this forum.
      > >>
      > >>Where OT = "On Topic"[/color]
      > >
      > >
      > > Nope. OT is the accepted "Off Topic".
      > >
      > > From one of my other responses:
      > >
      > >[color=darkred]
      > >>I was expressing (rather tersely) that a reference to Boost is off-topic in
      > >>this forum when there is an existing and preferred solution in C++ language.[/color][/color]
      >
      > Not a fan of irony, I see.[/color]

      I don't know what that means, so I'll leave it up to you to determine for
      yourself if I'm a fan or not.
      [color=blue]
      >
      > Why is it OT even to mention boost? Also, if you know of a "preferred
      > solution," why was it worth your time to criticize someone else, but not
      > worth your time to present the solution?[/color]

      I wasn't specifically aware of the preferred solution, I just new that it
      existed.

      Comment

      • Claudio Puviani

        #18
        Re: Formatting decimal places

        "David Harmon" <source@netcom. com> wrote[color=blue]
        > On Tue, 20 Apr 2004 10:41:14 -0700 in comp.lang.c++, Julie
        > <julie@nospam.c om> wrote,[color=green]
        > >[color=darkred]
        > >> I was expressing (rather tersely) that a reference to Boost is off-topic[/color][/color][/color]
        in[color=blue][color=green][color=darkred]
        > >> this forum when there is an existing and preferred solution in C++[/color][/color][/color]
        language.[color=blue]
        >
        > Boost is a collection of solutions in the C++ language. Widely accepted
        > and frequently preferred. Not in any way off-topic that I can see.
        > It does happen to be the wrong answer to the question of this thread,
        > but that's a different matter entirely.[/color]

        It's off-topic in the same way that all other third party libraries are
        off-topic, regardless of how good they may or may not be. It's not part of the
        language. If we open that door, the newsgroup will be flooded with threads
        about boost, QT, CommonC++, blitz, MFC, ATL, M++, Rogue Wave, wxwindows, and
        dozens upon dozens of others. These libraries are NOT the core standard C++
        language/libraries which is the topic of this newsgroup. This isn't to say that
        they're not valid and even interesting topics elsewhere, but they are out of
        place here.

        Claudio Puviani


        Comment

        • Dan Bloomquist

          #19
          Re:(ot) Formatting decimal places



          Julie wrote:[color=blue]
          > Jeff Schwab wrote:[color=green][color=darkred]
          >>>[/color]
          >>Not a fan of irony, I see.[/color]
          >
          > I don't know what that means, so I'll leave it up to you to determine for
          > yourself if I'm a fan or not.[/color]

          But Julie, it was a *joke*!

          Best, Dan.

          --


          No EXTRA stuff for email.

          Comment

          • Jeff Schwab

            #20
            Re: Formatting decimal places

            Claudio Puviani wrote:[color=blue]
            > These libraries are NOT the core standard C++
            > language/libraries which is the topic of this newsgroup.[/color]

            Where is that topic stated?

            Comment

            • David Harmon

              #21
              Re: Formatting decimal places

              On Tue, 20 Apr 2004 23:46:26 GMT in comp.lang.c++, "Claudio Puviani"
              <puviani@hotmai l.com> wrote,[color=blue]
              >It's off-topic in the same way that all other third party libraries are
              >off-topic, regardless of how good they may or may not be. It's not part
              > of the language.[/color]

              If you say that, you may as well say that all C++ code is off topic. It
              isn't part of the language. Unless it is an excerpt from your vendor's
              headers.
              [color=blue]
              >If we open that door, the newsgroup will be flooded with threads
              >about boost, QT, CommonC++, blitz, MFC, ATL, M++, Rogue Wave, wxwindows, and
              >dozens upon dozens of others.[/color]

              I don't know all of those. See also the "Available C++ Libraries FAQ"
              compiled by Nikki Locke. http://www.trumphurst.com/cpplibs/ or


              Some you list such as MFC and ATL are predominately off topic, as they
              are mostly about interfacing to a OS platform API and the problems are
              mostly API problems. But if a question about C++ happens to involve
              some fragment of code from MFC, that fact alone doesn't make it off
              topic.

              For the rest, if they are open and available, if they are attempting to
              live as standard conforming C++, then let them come! Very possibly such
              a library may contain not a line of off-topic code.

              Likewise, "re-invent all your own wheels" is not good advice for someone
              asking how to solve problems in C++.

              Of course a poster should read the FAQs "[5.8] How do I post a question
              about code that doesn't work correctly?" and "[5.9] Which newsgroup
              should I post my questions?" and use good judgement.

              Comment

              • Julie

                #22
                Re: (ot) Formatting decimal places

                Dan Bloomquist wrote:[color=blue]
                >
                > Julie wrote:[color=green]
                > > Jeff Schwab wrote:[color=darkred]
                > >>>
                > >>Not a fan of irony, I see.[/color]
                > >
                > > I don't know what that means, so I'll leave it up to you to determine for
                > > yourself if I'm a fan or not.[/color]
                >
                > But Julie, it was a *joke*!
                >
                > Best, Dan.
                >
                > --
                > http://lakeweb.net
                > http://ReserveAnalyst.com
                > No EXTRA stuff for email.[/color]

                Zing!

                Comment

                • Michiel Salters

                  #23
                  Re: Formatting decimal places

                  Julie <julie@nospam.c om> wrote in message news:<408545AE. C7FE7FDC@nospam .com>...[color=blue]
                  > Marcin Kalicinski wrote:[color=green]
                  > >
                  > > Uzytkownik "Andrew" <admckni@hqcnsg .navy.mil> napisal w wiadomosci
                  > > news:8e7fb04b.0 404200701.78f63 8bb@posting.goo gle.com...[color=darkred]
                  > > > I trying to format my output to display a set number of decimal
                  > > > places. I have been trying to use the <iomanip> setprecision(), but
                  > > > that will only display the total number of digits. Can someone please
                  > > > help me???? Thanks.[/color]
                  > >
                  > > Check out boost::format.
                  > >
                  > > Marcin[/color]
                  >
                  > Boost is OT in this forum.[/color]

                  But redirecting people to other resources is acceptable here.
                  Only discussing actual problems with Boost::format would be OT.
                  So I'll take your remark as an advice for follow-ups.

                  Regards,
                  Michiel Salters

                  Comment

                  • Claudio Puviani

                    #24
                    Re: Formatting decimal places

                    "Jeff Schwab" <jeffplus@comca st.net> wrote[color=blue]
                    > Claudio Puviani wrote:[color=green]
                    > > These libraries are NOT the core standard C++
                    > > language/libraries which is the topic of this newsgroup.[/color]
                    >
                    > Where is that topic stated?[/color]



                    "Only post to comp.lang.c++ if your question is about the C++ language itself.
                    For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately this
                    means your question must be answerable by looking into the C++ language
                    definition as determined by the ISO/ANSI C++ Standard document, and by planned
                    extensions and adjustments."

                    Clearly, this excludes third party libraries, unless they somehow made it into
                    the ISO/ANSI C++ Standard document.

                    Claudio Puviani


                    Comment

                    • Claudio Puviani

                      #25
                      Re: Formatting decimal places

                      "David Harmon" <source@netcom. com> wrote[color=blue]
                      > "Claudio Puviani" <puviani@hotmai l.com> wrote,[color=green]
                      > >It's off-topic in the same way that all other third party libraries are
                      > >off-topic, regardless of how good they may or may not be. It's not part
                      > > of the language.[/color]
                      >
                      > If you say that, you may as well say that all C++ code is off topic. It
                      > isn't part of the language. Unless it is an excerpt from your vendor's
                      > headers.[/color]

                      As I just quoted for someone else, "Only post to comp.lang.c++ if your question
                      is about the C++ language itself. For example, C++ code design, syntax, style,
                      rules, bugs, etc. Ultimately this means your question must be answerable by
                      looking into the C++ language definition as determined by the ISO/ANSI C++
                      Standard document, and by planned extensions and adjustments." This is from the
                      FAQ: http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

                      This can't be any clearer. If it's not about the C++ language itself, it's off
                      topic. You can get to Chicago driving a Ford, but that doesn't mean that
                      discussions of Chicago are in any way germane to a conversation about Fords.
                      [color=blue]
                      > Some you list such as MFC and ATL are predominately off topic, as they
                      > are mostly about interfacing to a OS platform API and the problems are
                      > mostly API problems. But if a question about C++ happens to involve
                      > some fragment of code from MFC, that fact alone doesn't make it off
                      > topic.[/color]

                      If the question is about C++, the MFC fragment can be removed and the example
                      isolated. If the MFC fragment can't be removed, then clearly, it's an MFC issue
                      and not a C++ issue.
                      [color=blue]
                      > For the rest, if they are open and available, if they are attempting to
                      > live as standard conforming C++, then let them come![/color]

                      If you want to make that kind of decision, you're free to start your own
                      newsgroup to cater to the side discussions (and continue to come here for the
                      C++ topics, of course). This newsgroup already has a mandate and as guests, we
                      have to respect it. The mandate makes no distinction with respect to the
                      openness, availability, or price of third party libraries. They're all
                      off-topic.
                      [color=blue]
                      > Very possibly such a library may contain not a line of off-topic code.[/color]

                      And copying such a line of code to ask a question about it -- if it's
                      independent of the rest of the library -- is perfectly on-topic. However,
                      discussing how to use the iterators in the boost graph library, for example,
                      would be blatantly off topic. It's an easy concept to test: can it be discussed
                      without reference to documentation other than the ISO/ANSI standard? If the
                      answer is "no", it's off-topic.
                      [color=blue]
                      > Likewise, "re-invent all your own wheels" is not good advice for someone
                      > asking how to solve problems in C++.[/color]

                      Stating that something is off-topic for this newsgroup isn't saying that the
                      person should reinvent the wheel. It just means that the solution needs to be
                      discussed elsewhere. If someone wants to use ODBC, saying that it's off-topic
                      doesn't mean that the person has to re-implement ODBC from scratch using only
                      standard C++. It just means that they need to go to a more appropriate forum.
                      [color=blue]
                      > Of course a poster should read the FAQs "[5.8] How do I post a question
                      > about code that doesn't work correctly?" and "[5.9] Which newsgroup
                      > should I post my questions?" and use good judgement.[/color]

                      Well, as I indicated above, 5.9 is very clear about what constitutes on-topic
                      material.

                      And, of course, we're all wildly violating [5.12]: "An extended flame war
                      against an off-topic posting is just as off-topic as the original off-topic
                      posting. The cure can be worse than the disease." :-)

                      Claudio Puviani


                      Comment

                      • Jeff Schwab

                        #26
                        Re: Formatting decimal places

                        Claudio Puviani wrote:[color=blue]
                        > "Jeff Schwab" <jeffplus@comca st.net> wrote
                        >[color=green]
                        >>Claudio Puviani wrote:
                        >>[color=darkred]
                        >>>These libraries are NOT the core standard C++
                        >>>language/libraries which is the topic of this newsgroup.[/color]
                        >>
                        >>Where is that topic stated?[/color]
                        >
                        >
                        > http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
                        >
                        > "Only post to comp.lang.c++ if your question is about the C++ language itself.
                        > For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately this
                        > means your question must be answerable by looking into the C++ language
                        > definition as determined by the ISO/ANSI C++ Standard document, and by planned
                        > extensions and adjustments."
                        >
                        > Clearly, this excludes third party libraries, unless they somehow made it into
                        > the ISO/ANSI C++ Standard document.[/color]

                        This excludes questions about thirdy-party libraries. IMO, it is in no
                        way OT to direct someone to an appropriate resource.

                        Comment

                        • Claudio Puviani

                          #27
                          Re: Formatting decimal places

                          "Jeff Schwab" <jeffplus@comca st.net> wrote[color=blue]
                          > Claudio Puviani wrote:[color=green]
                          > > "Jeff Schwab" <jeffplus@comca st.net> wrote
                          > >[color=darkred]
                          > >>Claudio Puviani wrote:
                          > >>
                          > >>>These libraries are NOT the core standard C++
                          > >>>language/libraries which is the topic of this newsgroup.
                          > >>
                          > >>Where is that topic stated?[/color]
                          > >
                          > >
                          > > http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
                          > >
                          > > "Only post to comp.lang.c++ if your question is about the C++ language[/color][/color]
                          itself.[color=blue][color=green]
                          > > For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately[/color][/color]
                          this[color=blue][color=green]
                          > > means your question must be answerable by looking into the C++ language
                          > > definition as determined by the ISO/ANSI C++ Standard document, and by[/color][/color]
                          planned[color=blue][color=green]
                          > > extensions and adjustments."
                          > >
                          > > Clearly, this excludes third party libraries, unless they somehow made it[/color][/color]
                          into[color=blue][color=green]
                          > > the ISO/ANSI C++ Standard document.[/color]
                          >
                          > This excludes questions about thirdy-party libraries. IMO, it is in no
                          > way OT to direct someone to an appropriate resource.[/color]

                          Agreed.


                          Comment

                          • Julie

                            #28
                            Re: Formatting decimal places

                            Jeff Schwab wrote:[color=blue]
                            >
                            > Claudio Puviani wrote:[color=green]
                            > > "Jeff Schwab" <jeffplus@comca st.net> wrote
                            > >[color=darkred]
                            > >>Claudio Puviani wrote:
                            > >>
                            > >>>These libraries are NOT the core standard C++
                            > >>>language/libraries which is the topic of this newsgroup.
                            > >>
                            > >>Where is that topic stated?[/color]
                            > >
                            > >
                            > > http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
                            > >
                            > > "Only post to comp.lang.c++ if your question is about the C++ language itself.
                            > > For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately this
                            > > means your question must be answerable by looking into the C++ language
                            > > definition as determined by the ISO/ANSI C++ Standard document, and by planned
                            > > extensions and adjustments."
                            > >
                            > > Clearly, this excludes third party libraries, unless they somehow made it into
                            > > the ISO/ANSI C++ Standard document.[/color]
                            >
                            > This excludes questions about thirdy-party libraries. IMO, it is in no
                            > way OT to direct someone to an appropriate resource.[/color]

                            That last statement is true only if qualified:

                            ....if there is no suitable implementation or construct in C++
                            _or_
                            if a C++ solution is provided in addition to the redirection.

                            So, this is what the original respondent should have said to make an on-topic
                            post:
                            [color=blue]
                            > I trying to format my output to display a set number of decimal
                            > places. I have been trying to use the <iomanip> setprecision(), but
                            > that will only display the total number of digits. Can someone please
                            > help me???? Thanks.[/color]

                            Use std::fixed, as in

                            cout << std::fixed << std::setprecisi on(3) << 1.23456789;

                            Alternatively, you can look into the third party boost library, specifically
                            boost::format.

                            Comment

                            • Jeff Schwab

                              #29
                              Re: Formatting decimal places

                              Julie wrote:[color=blue]
                              > Jeff Schwab wrote:
                              >[color=green]
                              >>Claudio Puviani wrote:
                              >>[color=darkred]
                              >>>"Jeff Schwab" <jeffplus@comca st.net> wrote
                              >>>
                              >>>
                              >>>>Claudio Puviani wrote:
                              >>>>
                              >>>>
                              >>>>>These libraries are NOT the core standard C++
                              >>>>>language/libraries which is the topic of this newsgroup.
                              >>>>
                              >>>>Where is that topic stated?
                              >>>
                              >>>
                              >>>http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
                              >>>
                              >>>"Only post to comp.lang.c++ if your question is about the C++ language itself.
                              >>>For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately this
                              >>>means your question must be answerable by looking into the C++ language
                              >>>definition as determined by the ISO/ANSI C++ Standard document, and by planned
                              >>>extensions and adjustments."
                              >>>
                              >>>Clearly, this excludes third party libraries, unless they somehow made it into
                              >>>the ISO/ANSI C++ Standard document.[/color]
                              >>
                              >>This excludes questions about thirdy-party libraries. IMO, it is in no
                              >>way OT to direct someone to an appropriate resource.[/color]
                              >
                              >
                              > That last statement is true only if qualified:
                              >
                              > ...if there is no suitable implementation or construct in C++[/color]

                              Boost *is* a suitable implementation in C++.

                              Comment

                              • Julie

                                #30
                                Re: Formatting decimal places

                                Jeff Schwab wrote:[color=blue]
                                >
                                > Julie wrote:[color=green]
                                > > Jeff Schwab wrote:
                                > >[color=darkred]
                                > >>Claudio Puviani wrote:
                                > >>
                                > >>>"Jeff Schwab" <jeffplus@comca st.net> wrote
                                > >>>
                                > >>>
                                > >>>>Claudio Puviani wrote:
                                > >>>>
                                > >>>>
                                > >>>>>These libraries are NOT the core standard C++
                                > >>>>>language/libraries which is the topic of this newsgroup.
                                > >>>>
                                > >>>>Where is that topic stated?
                                > >>>
                                > >>>
                                > >>>http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
                                > >>>
                                > >>>"Only post to comp.lang.c++ if your question is about the C++ language itself.
                                > >>>For example, C++ code design, syntax, style, rules, bugs, etc. Ultimately this
                                > >>>means your question must be answerable by looking into the C++ language
                                > >>>definition as determined by the ISO/ANSI C++ Standard document, and by planned
                                > >>>extensions and adjustments."
                                > >>>
                                > >>>Clearly, this excludes third party libraries, unless they somehow made it into
                                > >>>the ISO/ANSI C++ Standard document.
                                > >>
                                > >>This excludes questions about thirdy-party libraries. IMO, it is in no
                                > >>way OT to direct someone to an appropriate resource.[/color]
                                > >
                                > >
                                > > That last statement is true only if qualified:
                                > >
                                > > ...if there is no suitable implementation or construct in C++[/color]
                                >
                                > Boost *is* a suitable implementation in C++.[/color]

                                I can't believe you still don't understand what I'm saying. I'll try to
                                clarify:

                                ....if there is no suitable implementation in the standard C++ library or no
                                suitable construct in the native C++ language

                                Comment

                                Working...