Results 1 to 8 of 8
  1. #1

    Default how add or subtract number format with comma and dot (.) in visual basic


    gud day istoryans..

    pls help me..dili jud mo add or subract kung naa commas and . ..

    like 343,333.50

    if imo na i subract og 1,000.00
    dili niya ma subract..

    ples help thanks.

    nag libog na au ko..

    ang first 3 digit nga 343 ra iya ma subract og ma add..

  2. #2
    i convert lang na ang operands to double (or equivalent ana nga datatype sa vb)
    then mas dali na ang addition ug subtraction.
    kung kailangan nimo ang comma sa result kay imo lang na i format

  3. #3
    try using cdec() function

  4. #4
    Elite Member
    Join Date
    Aug 2008
    Posts
    1,053
    Blog Entries
    1
    string representation is different from the value of the variable you declared. thus, variable declared as double can be represented with comma or decimal places.

  5. #5
    use CCur() function pre. this function converts your input to currency value..

    e.g.

    Label1 = CCur(Text1) - CCUr(Text2)


    hope this helps. happy coding..

  6. #6
    @bbriones

    sir, sa addition ra siya ok sir..pero sa subraction(-) kay mo add japon ang result sir..y man?
    kung plus(+) kay ok ra siya

    @split_nutz
    sir kay dili ni siya mo work, ang first 3 digit ra iya ma add or subtract..

    thanks. au..
    hoping ma ok na ni..ty

  7. #7
    Quote Originally Posted by AMD_earl View Post
    @split_nutz
    sir kay dili ni siya mo work, ang first 3 digit ra iya ma add or subtract..

    thanks. au..
    hoping ma ok na ni..ty
    ayg sir2 dra pre..heheh in this world we r all equal

    back 2 d topic.. dpat wlay spaces after sa comma.

    try this code as ur reference:

    Dim a As String
    Dim b As String

    a = "343,333.50"
    b = "1,000.00"
    Label1 = CCur(a) + CCur(b)


    hope this helps


    if still it doesn't work..pls post ur codes here.

  8. #8
    are you using a textbox as input? if so, use val(textboxt.text) to get the actual "numerical" value in your textbox. also, you should use a double variable type to store your values and make sure that you are using double for ALL the values in your equation.

  9.    Advertisement

Similar Threads

 
  1. Want To Buy: dual core or pentium d procesor with hsf and 2 gb memory ddr2
    By metallica in forum Computers & Accessories
    Replies: 12
    Last Post: 02-14-2012, 06:19 PM
  2. How to open a file in visual basic.
    By AMD_earl in forum Programming
    Replies: 6
    Last Post: 09-09-2010, 04:15 PM
  3. For Trade: or for sale KU990 with skin and complete set
    By chinwin in forum Cellphones & Accessories
    Replies: 12
    Last Post: 11-30-2009, 07:11 PM
  4. how to use ADODC in Visual Basic
    By arbie_mon in forum Software & Games (Old)
    Replies: 0
    Last Post: 05-05-2006, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top