Formatting an HTML table using VB.Net

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

    Formatting an HTML table using VB.Net

    Hi all :-)

    I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
    Here is the snippet of code for the cell I'm trying to format:

    Dim ld_tot_pet_clea n_fee_calc As Double
    ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
    ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
    Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
    Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

    lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

    Case "D"
    ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
    Return ls_format

    I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
    <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
    The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

    TIA

    Coleen
  • One Handed Man \( OHM - Terry Burns \)

    #2
    Re: Formatting an HTML table using VB.Net

    Try using Decimal instead of Double.



    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .
    If U Need My Email ,Ask Me

    Time flies when you don't know what you're doing

    "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
    Hi all :-)

    I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
    Here is the snippet of code for the cell I'm trying to format:

    Dim ld_tot_pet_clea n_fee_calc As Double
    ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
    ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
    Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
    Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

    lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

    Case "D"
    ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
    Return ls_format

    I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
    <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
    The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

    TIA

    Coleen

    Comment

    • Charles Law

      #3
      Re: Formatting an HTML table using VB.Net

      Hi Coleen

      I haven't tried this, but if I were doing it I would use

      "#,##0.00"

      HTH

      Charles


      "Coleen" <coleenholley@y aho.com> wrote in message
      news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
      Hi all :-)

      I have a weird formatting problem with an HTML table that I am populating
      using VB.Net and HTML.
      Here is the snippet of code for the cell I'm trying to format:

      Dim ld_tot_pet_clea n_fee_calc As Double
      ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
      ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
      Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee,
      "D")
      Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

      lo_misc_func.Fo rmatMC calls a function that formats a variable into an
      Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to
      format this as a double. The value for this calculation is 114.80 - I can
      not get the variable to format correctly as .80, it will not format the 0
      after the 8. The format in the function is done as:

      Case "D"
      ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
      Return ls_format

      I have never had problems with this format function before. The value of
      the cell is populated in the html of the table as:
      <td class="table" style="FONT-WEIGHT: bold"
      width="75"><%=l d_tot_pet_clean _fee%></td>
      The weird thing is that in another table with the exact same formatting and
      table structure, it works just fine. Also, as you can see, I've tried to
      make certain that it is working by doing a response.write - which works
      perfectly. Any suggestion as to how I can force it to format the 0?

      TIA

      Coleen


      Comment

      • Coleen

        #4
        Re: Formatting an HTML table using VB.Net

        I will try that, thanks. It just seems strange that this works perfectly in other places using a double data type.
        "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message news:%23CXF2vXp EHA.2588@TK2MSF TNGP12.phx.gbl. ..
        Try using Decimal instead of Double.



        --

        OHM ( Terry Burns )
        . . . One-Handed-Man . . .
        If U Need My Email ,Ask Me

        Time flies when you don't know what you're doing

        "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
        Hi all :-)

        I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
        Here is the snippet of code for the cell I'm trying to format:

        Dim ld_tot_pet_clea n_fee_calc As Double
        ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
        ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
        Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
        Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

        lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

        Case "D"
        ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
        Return ls_format

        I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
        <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
        The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

        TIA

        Coleen

        Comment

        • Coleen

          #5
          Re: Formatting an HTML table using VB.Net

          Okay, I finally got a chance to go back and try your suggestion (after all this is just formatting, not a "major" problem) - it doesn't make a difference. It still won't display it as .80. So, I went back to the calculation and tied formatting at the calculation level - it still doesn't work! This is really weird, so I'm checking into why one cell formatted in the HTML table directly above this one formats properly, and this one doesn't...

          If you have any other suggestions, I'm open...

          Thanks!
          "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message news:%23CXF2vXp EHA.2588@TK2MSF TNGP12.phx.gbl. ..
          Try using Decimal instead of Double.



          --

          OHM ( Terry Burns )
          . . . One-Handed-Man . . .
          If U Need My Email ,Ask Me

          Time flies when you don't know what you're doing

          "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
          Hi all :-)

          I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
          Here is the snippet of code for the cell I'm trying to format:

          Dim ld_tot_pet_clea n_fee_calc As Double
          ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
          ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
          Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
          Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

          lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

          Case "D"
          ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
          Return ls_format

          I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
          <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
          The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

          TIA

          Coleen

          Comment

          • Charles Law

            #6
            Re: Formatting an HTML table using VB.Net

            Coleen

            Did you try my suggestion?

            Charles


            "Coleen" <coleenholley@y aho.com> wrote in message
            news:uWbfKdbpEH A.1164@TK2MSFTN GP10.phx.gbl...
            Okay, I finally got a chance to go back and try your suggestion (after all
            this is just formatting, not a "major" problem) - it doesn't make a
            difference. It still won't display it as .80. So, I went back to the
            calculation and tied formatting at the calculation level - it still doesn't
            work! This is really weird, so I'm checking into why one cell formatted in
            the HTML table directly above this one formats properly, and this one
            doesn't...

            If you have any other suggestions, I'm open...

            Thanks!
            "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
            news:%23CXF2vXp EHA.2588@TK2MSF TNGP12.phx.gbl. ..
            Try using Decimal instead of Double.



            --

            OHM ( Terry Burns )
            . . . One-Handed-Man . . .
            If U Need My Email ,Ask Me

            Time flies when you don't know what you're doing

            "Coleen" <coleenholley@y aho.com> wrote in message
            news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
            Hi all :-)

            I have a weird formatting problem with an HTML table that I am populating
            using VB.Net and HTML.
            Here is the snippet of code for the cell I'm trying to format:

            Dim ld_tot_pet_clea n_fee_calc As Double
            ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
            ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
            Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee,
            "D")
            Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

            lo_misc_func.Fo rmatMC calls a function that formats a variable into an
            Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to
            format this as a double. The value for this calculation is 114.80 - I can
            not get the variable to format correctly as .80, it will not format the 0
            after the 8. The format in the function is done as:

            Case "D"
            ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
            Return ls_format

            I have never had problems with this format function before. The value of
            the cell is populated in the html of the table as:
            <td class="table" style="FONT-WEIGHT: bold"
            width="75"><%=l d_tot_pet_clean _fee%></td>
            The weird thing is that in another table with the exact same formatting and
            table structure, it works just fine. Also, as you can see, I've tried to
            make certain that it is working by doing a response.write - which works
            perfectly. Any suggestion as to how I can force it to format the 0?

            TIA

            Coleen


            Comment

            • One Handed Man \( OHM - Terry Burns \)

              #7
              Re: Formatting an HTML table using VB.Net

              The only other thing I can suggest is to widen the cell width, perhaps it's marginally too narrow and consequently not being displayed

              --

              OHM ( Terry Burns )
              . . . One-Handed-Man . . .
              If U Need My Email ,Ask Me

              Time flies when you don't know what you're doing

              "Coleen" <coleenholley@y aho.com> wrote in message news:uWbfKdbpEH A.1164@TK2MSFTN GP10.phx.gbl...
              Okay, I finally got a chance to go back and try your suggestion (after all this is just formatting, not a "major" problem) - it doesn't make a difference. It still won't display it as .80. So, I went back to the calculation and tied formatting at the calculation level - it still doesn't work! This is really weird, so I'm checking into why one cell formatted in the HTML table directly above this one formats properly, and this one doesn't...

              If you have any other suggestions, I'm open...

              Thanks!
              "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message news:%23CXF2vXp EHA.2588@TK2MSF TNGP12.phx.gbl. ..
              Try using Decimal instead of Double.



              --

              OHM ( Terry Burns )
              . . . One-Handed-Man . . .
              If U Need My Email ,Ask Me

              Time flies when you don't know what you're doing

              "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
              Hi all :-)

              I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
              Here is the snippet of code for the cell I'm trying to format:

              Dim ld_tot_pet_clea n_fee_calc As Double
              ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
              ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
              Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
              Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

              lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

              Case "D"
              ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
              Return ls_format

              I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
              <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
              The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

              TIA

              Coleen

              Comment

              • Coleen

                #8
                Re: Formatting an HTML table using VB.Net

                Hi Charles,
                Yes, I did try using the regular format process. The really weird thing is
                that I can get it to format correctly in the Response.write (using both the
                function and the format process), but as soon as I send it to the variable
                it truncates it. I will try OHM's suggestion to widen the cell; however,
                the cell in the table above is the same size and the value in it display
                just fine. I have no idea why the zero won't display correctly. I'm
                looking at the entire code for the HTML table now, to see if maybe the
                author put some formatting in the HTML. I'm not the original programmer on
                this, I'm just doing maintenance...

                Thanks for all the suggestions...

                Coleen

                "Charles Law" <blank@nowhere. com> wrote in message
                news:eBrui3XpEH A.3592@TK2MSFTN GP14.phx.gbl...[color=blue]
                > Hi Coleen
                >
                > I haven't tried this, but if I were doing it I would use
                >
                > "#,##0.00"
                >
                > HTH
                >
                > Charles
                >
                >
                > "Coleen" <coleenholley@y aho.com> wrote in message
                > news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
                > Hi all :-)
                >
                > I have a weird formatting problem with an HTML table that I am populating
                > using VB.Net and HTML.
                > Here is the snippet of code for the cell I'm trying to format:
                >
                > Dim ld_tot_pet_clea n_fee_calc As Double
                > ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
                > ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc,[/color]
                "D")[color=blue]
                > Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee,
                > "D")
                > Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))
                >
                > lo_misc_func.Fo rmatMC calls a function that formats a variable into an
                > Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to
                > format this as a double. The value for this calculation is 114.80 - I can
                > not get the variable to format correctly as .80, it will not format the 0
                > after the 8. The format in the function is done as:
                >
                > Case "D"
                > ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
                > Return ls_format
                >
                > I have never had problems with this format function before. The value of
                > the cell is populated in the html of the table as:
                > <td class="table" style="FONT-WEIGHT: bold"
                > width="75"><%=l d_tot_pet_clean _fee%></td>
                > The weird thing is that in another table with the exact same formatting[/color]
                and[color=blue]
                > table structure, it works just fine. Also, as you can see, I've tried to
                > make certain that it is working by doing a response.write - which works
                > perfectly. Any suggestion as to how I can force it to format the 0?
                >
                > TIA
                >
                > Coleen
                >
                >[/color]


                Comment

                • Coleen

                  #9
                  Re: Formatting an HTML table using VB.Net

                  For anyone wanting to know how I solved this problem, here it is:

                  The imbedded code <%=variablename %> strips the formatting off when putting it in the table, so even though it looked like the variables in other cells were formatting correctly, they weren't. It strips the 0's off of the end, so I solved this by removing the <%variablename% > referrrences:
                  <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                  and putting the variables in the cell via VB in the code behind:
                  tbl_cleanup.Row s(9).Cells(1).T ext = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                  works perfectly! So if anyone is populating variables in the imbedded HTML, be aware that it strips the formatting...

                  Thanks,

                  Coleen
                  "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
                  Hi all :-)

                  I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
                  Here is the snippet of code for the cell I'm trying to format:

                  Dim ld_tot_pet_clea n_fee_calc As Double
                  ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
                  ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
                  Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                  Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

                  lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

                  Case "D"
                  ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
                  Return ls_format

                  I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
                  <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                  The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

                  TIA

                  Coleen

                  Comment

                  • One Handed Man \( OHM - Terry Burns \)

                    #10
                    Re: Formatting an HTML table using VB.Net

                    Had to be something like that didnt it. I hate problems like this.


                    At least you cracked it.

                    --

                    OHM ( Terry Burns )
                    . . . One-Handed-Man . . .
                    If U Need My Email ,Ask Me

                    Time flies when you don't know what you're doing

                    "Coleen" <coleenholley@y aho.com> wrote in message news:eDhSKLlpEH A.1988@TK2MSFTN GP09.phx.gbl...
                    For anyone wanting to know how I solved this problem, here it is:

                    The imbedded code <%=variablename %> strips the formatting off when putting it in the table, so even though it looked like the variables in other cells were formatting correctly, they weren't. It strips the 0's off of the end, so I solved this by removing the <%variablename% > referrrences:
                    <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                    and putting the variables in the cell via VB in the code behind:
                    tbl_cleanup.Row s(9).Cells(1).T ext = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                    works perfectly! So if anyone is populating variables in the imbedded HTML, be aware that it strips the formatting...

                    Thanks,

                    Coleen
                    "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
                    Hi all :-)

                    I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
                    Here is the snippet of code for the cell I'm trying to format:

                    Dim ld_tot_pet_clea n_fee_calc As Double
                    ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
                    ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
                    Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                    Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

                    lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

                    Case "D"
                    ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
                    Return ls_format

                    I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
                    <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                    The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

                    TIA

                    Coleen

                    Comment

                    • Coleen

                      #11
                      Re: Formatting an HTML table using VB.Net

                      Thanks!
                      "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message news:%23FY5rntp EHA.376@TK2MSFT NGP14.phx.gbl.. .
                      Had to be something like that didnt it. I hate problems like this.


                      At least you cracked it.

                      --

                      OHM ( Terry Burns )
                      . . . One-Handed-Man . . .
                      If U Need My Email ,Ask Me

                      Time flies when you don't know what you're doing

                      "Coleen" <coleenholley@y aho.com> wrote in message news:eDhSKLlpEH A.1988@TK2MSFTN GP09.phx.gbl...
                      For anyone wanting to know how I solved this problem, here it is:

                      The imbedded code <%=variablename %> strips the formatting off when putting it in the table, so even though it looked like the variables in other cells were formatting correctly, they weren't. It strips the 0's off of the end, so I solved this by removing the <%variablename% > referrrences:
                      <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                      and putting the variables in the cell via VB in the code behind:
                      tbl_cleanup.Row s(9).Cells(1).T ext = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                      works perfectly! So if anyone is populating variables in the imbedded HTML, be aware that it strips the formatting...

                      Thanks,

                      Coleen
                      "Coleen" <coleenholley@y aho.com> wrote in message news:OjrG$TXpEH A.132@TK2MSFTNG P14.phx.gbl...
                      Hi all :-)

                      I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML.
                      Here is the snippet of code for the cell I'm trying to format:

                      Dim ld_tot_pet_clea n_fee_calc As Double
                      ld_tot_pet_clea n_fee_calc = li_net_total_ca lc * 0.0075
                      ld_tot_pet_clea n_fee = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D")
                      Session("tot_pe t_clean_fee") = lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee, "D")
                      Response.Write( lo_misc_func.Fo rmatMC(ld_tot_p et_clean_fee_ca lc, "D"))

                      lo_misc_func.Fo rmatMC calls a function that formats a variable into an Integer, Long or Double ("I", "L", or "D"). As you can see, I'm trying to format this as a double. The value for this calculation is 114.80 - I can not get the variable to format correctly as .80, it will not format the 0 after the 8. The format in the function is done as:

                      Case "D"
                      ls_format = Format(CDbl(ls_ format), "##,##0.#0" )
                      Return ls_format

                      I have never had problems with this format function before. The value of the cell is populated in the html of the table as:
                      <td class="table" style="FONT-WEIGHT: bold" width="75"><%=l d_tot_pet_clean _fee%></td>
                      The weird thing is that in another table with the exact same formatting and table structure, it works just fine. Also, as you can see, I've tried to make certain that it is working by doing a response.write - which works perfectly. Any suggestion as to how I can force it to format the 0?

                      TIA

                      Coleen

                      Comment

                      Working...