Results 1 to 4 of 4
  1. #1
    bullstreetboy is offline Member
    Join Date
    Apr 2009
    Posts
    10
    Rep Power
    0

    Default VB Net FIX equivalent?

    I'm completely new to Java

    Is there an equivalent to the VB Net FIX statement in Java?

    dim Res as integer = fix(-8.6) would give Res = -8.
    dim Res as integer = fix(8.6) would give Res = 8.

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    10

    Default

    a quick and dirty way to do it would be to do a casting of int:
    Java Code:
    double x = 72.3;
    double y = 0.34;
    double z = -5.5;
      	
    int intX = (int)x;
    int intY = (int)y;
    int intZ = (int)z;
    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    bullstreetboy is offline Member
    Join Date
    Apr 2009
    Posts
    10
    Rep Power
    0

    Default

    Thanks Chris - simple when you know how!

  4. #4
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    10

    Default

    Welcome...

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. M$ (.NET) Form Load() event equivalent in SWT
    By erosszz_jp@yahoo.co.jp in forum SWT / JFace
    Replies: 0
    Last Post: 02-16-2009, 04:35 AM
  2. [SOLVED] Java equivalent to X11 Work Procedure
    By LongHitter in forum New To Java
    Replies: 0
    Last Post: 01-12-2009, 12:36 PM
  3. Filter a file in java (unix cut command equivalent)
    By marcosabel in forum New To Java
    Replies: 0
    Last Post: 02-11-2008, 08:26 PM
  4. Replies: 1
    Last Post: 11-21-2007, 01:18 PM
  5. Php explode function, equivalent java
    By fernando in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 05:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •