0
Public Class Form1
    
    Private Sub btnCompute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCompute.Click
        Dim percent As Double

        percent = (txtGrams.Text * 9) / txtCalories.Text * 100

        Dim fmtstr As String = "{0, -15:p3}"
        lstResult.Items.Clear()
        lstResult.Items.Add(String.Format(fmtstr, txtFood.Text & " containts " & percent & _
" calories from fat."))
    End Sub
End Class

------------------------------------------------------------------------
Above is the code i have created.
I am having issue with the variant "Percent" to display 37.50% instead of 37.5. Hope someone can help me.

Thank you in advance!

Edited by mjltech: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by mjltech
0

Thank you
could you give me a hint on how to have the number be 37.50 instead od 37.5

thanks

0

i know about the Formatpercent.
My issue is that i am unable to figure out where it is suppose to go.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.