1 Replies - 3672 Views - Last Post: 10 April 2011 - 06:28 AM Rate Topic: -----

#1 clarkstar1  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 14
  • Joined: 25-March 11

vb.net percentage's help

Posted 10 April 2011 - 05:47 AM

HI I got a noob question. I been working with percentages in vb.net, i'm wondering if this is the correct way to declare a percentage of say %20.
thanks. :)

Const CommisionRateDecimal As Decimal = 20 / 100


Is This A Good Question/Topic? 0
  • +

Replies To: vb.net percentage's help

#2 dbasnett  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 117
  • View blog
  • Posts: 646
  • Joined: 01-October 08

Re: vb.net percentage's help

Posted 10 April 2011 - 06:28 AM

Pick one
        Const CommisionRateDecimal As Decimal = CDec(20 / 100)
        Const CommisionRateDecimal As Decimal = 0.2D


        Debug.WriteLine(CommisionRateDecimal.ToString("p1")) 'to check


Was This Post Helpful? 1
  • +
  • -

Page 1 of 1