Conversion of a floating point type field

Hi,
I'm fetching field ATFLV from table AUSP for a particular value of ATINN.ATFLV is a floating point type field.
Can anyone please guide me as to how to convert this field(ATFLV) from floating point no. to a simple no.?
Helpful answers will be rewarded.
Regards,
Sipra

hi,
Do like this,
float f = 234.33;
int i = (int) f; // i has value 234.
reward points if helpful..

Similar Messages

  • Floating Point type in selection screen

    Hi,
    I need to use a field ausp-atflv in selection screen. Field atflv of type Floating point. But in selection-screen, Floating point type variables are not allowed.
    Any suggestions please.
    Thanks
    Aravind.R

    Yes Arvind,
    Replace the type with a TYPE P with DECIMALS addtion variable.
    Regards
    Abhii

  • Char is a floating point type!?!

    The sample test on http://www.scja.de/scja-mock-exam-section1.html states that char is a floating point type..... is this correct?

    No it isn't ! Sorry for the mistake - it's corrected right now.
    regards,
    Ralf Peter

  • Regular Expression for floating point numeric field

    Hi,
    the requirements for the field are as follows:
    - floating point numeric field 7 digits in length
    - the field must contain a decimal (dot) and either one, two or three digits to the right of the decimal
    - (leading zeroes are required if needed to fill up the 7 characters)
    My example shown below does not check for the length of 7 characters:
    public static void main(String[] args) {
        String str = "04100.0";
        System.out.println(str);
        Pattern f_1To7 = Pattern.compile("^([0-9]*\\.[0-9]{1,3})$");
        Matcher matcher = f_1To7.matcher(str);
        if (matcher.find()) {
            // yes, we've found something
            System.out.println("We matched the pattern!");
        } else {
            System.out.println("Better luck next time!");
    }When changing the pattern to
    ^([0-9]*\\.[0-9]{1,3}){7}$the whole expression will be repeated 7 times - but I would like to have to whole String to be 7 characters long.
    Here are some examples for the field:
    050.500 or 04100.0Thanks a lot and best regards,
    - Stephan

    Jackler wrote:
    Perhaps I did not express clearly enough. My problem is not a java issue - what I need is a regular expression (pattern) suiting my requirements:
    -floating point numeric field 7 digits in length
    -contains a decimal and either one, two or three digits to the right of the decimal
    ...Assuming that you are going to use Java*, you could use a lookahead at the start of your regex:
    "^(?=\\d{4,6}\\.\\d{1,3}$).{8}$"Meaning:
    ^             # match the start of the string
    (?=           #
      \d{4,6}     #   ensure that there are between 4 and 6 digits...
      \.          #   followed by a DOT...
      \d{1,3}     #   followed by 1 to 3 digits
    .{8}$         # match exactly 8 characters directly followed by the end of the string* or some other language that has look-ahead support (most PCRE implementations have them)

  • Byte Order for Floating Point Types

    I need to send an array of floating point values from an x86 C++ application to a Java application. I am using a socket to transfer the data. What, if anything, do I have to do about preserving the correct byte order?

    Probably nothing.
    If you do end up having a problem, look at the java.nio package. Specfically, java.nio.ByteOrder, and java.nio.Double/FloatBuffer.
    To be completely safe, I think I'd probably send an enum in some kind of header that indicates what byte order your C++ is sending and use the *Buffer classes to automatically handle the conversion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Floating Point Type

    i have a input value say 213.
    i have to match it with a field in table AUSP-ATFLV( type F size 16 decimals 16)
    the data in the field is of format  2.1300000000000000E+02
    how can i match the value 213 with this value.

    Try this logic
    parameters: a(16).
    data: a1 type f.
    a1 = a.
          if sy-subrc eq 0.
          write:/ 'india'.
          endif.
    If usefull reward points helpfull.....

  • Floating Point arithmetic conversion

    Hi Everyone,
    Can you tell me how to convert a floating point arithmetic field value to a currency field value.
    thanks,
    chan

    Hi,
    I hope simple move statement should work.
    MOVE l_float TO l_curr.
    Make sure that curr field has enough length.
    Thanks,
    Vinod.

  • F suffix for floating point.

    Okay, I'm a proficient c++ programmer and have been learning Java for only a few weeks now.
    I have a question about the f suffix for floating point varibles such as float f = 3.14f;
    The f suffix casts this as float right? which is the same as float f = (float) 3.14; Correct?
    Why do we have to add the f suffix in the first place? Doesn't the compiler know that we want a float and not a double? (single-precision 32-bit instead of double precision 64 bit) I really do not understand the concept here or why they need the f suffix.
    Can someone explain?

    ThePHPGuy wrote:
    The f suffix denotes that the literal is of a floating-point type.Yes. The d suffix does the same.
    Java has two different types of floating-point numbers.Right.
    The type double is the default type.Right.
    The float type can have a double and a float literal. Is this true or false?No. At least not in any way I understand it.
    I think you're confusing two things:
    "floating point number" is any number in the IEEE floating point format.
    "float" is a datatype holding a 32bit floating point number.
    "double" is a datatype holding a 64bit floating point number.
    floating point number literals can be either double literals (without suffix or if the "d" suffix is used) or float literals (when the "f" suffix is used).

  • "File Browse" type item: at what point the fields mime_type, file_name, last_update_date get their values?

    Hi there,
    I have an issue with "File Browse" type item, my question is: at what point the fields mime_type, file_name, last_update_date get their values? I want to add them to the collection but if I try to do it in Process "On Submit - After Computations and Validations" the values in those fields are still null (that's for the insert, and for the update they have old values). Also I don't seem to be able to add blob to the collection ("File Browse" type item (which has the source as blob database column) can't be assigned as parameter p_blob001 of APEX_COLLECTION.ADD_MEMBER, error is: PLS-00306: wrong number or types of arguments in call to 'ADD_MEMBER').
    What I am trying to do is this: I have parent table (TABLE1), and child table (TABLE2).  In TABLE2 I store documents. I have a main page that is form on TABLE1, and on it I have button "Add documents" that opens popup window with form on TABLE2. On submit of popup page I want to avoid inserting document into TABLE2, instead I want to send data to the main page (using collection) and insert in only once the main page is submitted.
    I would appreciate any advice on this...
    Thanks,
    Tanya

    Hello Tanya,
    Can you post your PL/SQL code which you are trying?
    Regards,
    Hari

  • Pack  and Floating Point Data Type in ABAP

    Dear All,
    I am new to ABAP. Started with data types. Came across pack and floating point.
    Please let me know what PACK  and Floating Point stands for with few examples and the main difference between them.
    Regards
    Arun V

    Hi,
    You'd better ask this question in ABAP forum http://forums.sdn.sap.com/forum.jspa?forumID=50 .
    Best Regards,
    Ada

  • Precision loss - conversions between exact values and floating point values

    Hi!
    I read this in your SQL Reference manual, but I don't quite get it.
    Conversions between exact numeric values (TT_TINYINT, TT_SMALLINT, TT_INTEGER, TT_BIGINT, NUMBER) and floating-point values (BINARY_FLOAT, BINARY_DOUBLE) can be inexact because the exact numeric values use decimal precision whereas the floating-point numbers use binary precision.
    Could you please give two examples: one where a TT_TINYINT is converted to a BINARY_DOUBLE and one when a TT_BIGINT is converted into a DOUBLE, both cases give examples on lost precision? This would be very helpful.
    Thanks!
    Sune

    chokpa wrote:
    Public Example (float... values){}
    new Example (1, 1e2, 3.0, 4.754);It accepts it if I just use 1,2,3,4 as the values being passed in, but doesn't like it if I use actual float values.Those are double literals, try
    new Example (1f, 1e2f, 3.0f, 4.754f);

  • Can a field validation point to fields of another record type?

    Field Validation based on another Record Type Field
    I am trying to build validation into a custom object that sums fields under the Account record type.
    The names of the fields from OBI (the table location and field name):
    "- Account Custom Metrics".S_INT_13+"- Account Custom Metrics".S_INT_14+"- Account Custom Metrics".S_INT_11
    My questions: can a field validation point to fields of another record type? My thought was that if OBI can look across record types than all of CRM should be able to, including field validations.
    Thank you,
    David

    Hi !
    I'm afraid this is not possible for the moment. You'll have to wait for the Release 16 I think to have such possibilities.
    The R16 will allow you to create workflow rules accross different record types (e.g. Create a task on the Account linked to the service request when a new service request is created). I hope there will be the same possibilities with the validation rules...
    Hope this will help, feel free to ask more.
    Max

  • Field Activity Type and Service Point Type from CC&B

    Our customer is migrating their CIS to CC&B. It is my understanding that the CC&B Field Activity Type is similar to CIS Service Order without the Service Point Type. (Service Point Type is Water or Electricity)
    The two valuescome from CC&B in their own fields.
    QUESTION: Does MWM 1.5.0.8.1 and ORS need these fields to be concatenated from CC&B or are these fields automatically concatenated via the router before the field order is created in MWM and then sent to ORS?

    Almost forgot - by default, it's one-to-one....but you can change this behavior.
    In the direct integration from CCB to MWM, the MWM Field Order Type is actually CCB's "JOB_CD" (which is a characteristic on the Field Activity Type). You could set the same value for "JOB_CD" for numerous Field Activity Types in CCB.

  • Floating point conversation

    Dear all,
        In a particular filed i entered value as 60.800 kg. But when i try to pick the value   i found that the value is stored in floating pont format ie 6.080000000000e+00 . Actually i need it in integer format .Is any function module available to convert floating point to integer.
    Regards
    Mahesh V

    Why use a function module?
    DATA: l_val_int type i,
          l_val_flt type f,
          l_val_pck type p decimals 2.
    l_val_flt = '6.080000000000e+00'.
    l_val_int = l_val_flt.
    l_val_pck = l_val_pck.
    matt

  • Floating point format conversions

    Hi All,
    I have a binary file that has 8 byte floats in it written in VAX D floating point format. It also has 4 byte integers in it. I have to read this file on a Sun Sparc. To get the correct value of the integers I just swap the bytes around and write out the int value, so bytes 0123 get rearranged to be 3210 and then I use that as my int. I tried that with the doubles, reorder bytes 01234567 to 76543210 and then write out the double value but I don't get the value that was stored.
    I read 8 bytes from the file, I'm supposed to get 512.0 but I get garbage.
    The hex dump of the file shows: 0045 0000 0000 0000
    I can't come up with a way to turn that into 512.0
    Another one is 360448.0 with hex dump: b049 0000 0000 0000
    Can anyone show me how to manipulate these bits/bytes to get the correct values?
    Thanks

    Hi Legosa,
    Thanks for looking for a solution for me. The linkhttp://nicmos2.as.arizona.edu/thompson/kfocas/vax2sun.c
    has a C implementation of exactly what I need and has saved me a lot of time and work. Translation to Java will have to use bit shifting I think, the C unions make for a nice implementation.
    I also have to read PC and Cray generated files on my Sun.
    I have found that, like the Vax, Intel x86 including pentium are all little endian and use IEEE so I'm guessing that I just have to do the byte swapping to translate from PC to Sun.
    Crays are Big endian so I don't need byte swapping but I do need to do some manipulation of the exponent and the mantissa.
    Do you know where I might find code that others have done for PC to Sun and Cray to Sun conversions of integers, floats and doubles?
    BTW, for those who may read this later, the solution in vax2sun.c isn't quite right, the author forgot to use the least significant 32 bits and lost 3 bits in the middle but it is very close. To make it closer you have to change the vax2sun.c code a little.
    Replace mantissa and lomant with
    In union ieeebuf
    int mantissa1:20
    int mantissa2:3
    int mantissa3:29
    In union vaxbuf
    int mantissa1:20
    int mantissa2:3
    int mantissa3:29
    int lost_bits:3
    In the code replace d.mantissa = v.mantissa/8 with:
    d.mantissa1 = v.mantissa1
    d.mantissa2 = v.mantissa2
    d.mantissa3 = v.mantissa3
    My few tests showed this gave very good results. The lost_bits are lost because ieee needs 3 more bits for its exponent so it doesn't have room for all of the vax mantissa bits. A little bigger range means a little less precision.

Maybe you are looking for

  • The project could not be prepared for publishing because an error occurred. (-108)

    Got the following error while trying to share my project: "The project could not be prepared for publishing because an error occurred. (-108)" I got this error everywhere: share to idvd, share - export movie ... Computer: MAcbook Pro 2.3GHz Intel Cor

  • '?' appearing in DBMS_OUTPUT

    hi, I have a procedure which is fetching some data into a cursor. then printing it using FOR loop with DBMS_OUTPUT.PUT_LINE(). when this procedure is run manually, it outputs result normally. But when the same procedure is triggered with Control-M to

  • Exports too much footage.

    Hi, I'm trying to export a movie i made, but overtime I do it gets messed up. When I logged and captured my footage, it did get messed up, so when i was editing I had too place it so a red box that says "+2:05" occurs on the video. I know the problem

  • WebDynpro (Fields modification)

    Hello, When select a leave request notification item from universal worklist, it opens a new page where you can approve or refuse an absence. I need to modify some fields of  this screen. I tried with Content Admin and CTRL+Right Click on the field a

  • Verify Labview Vis before starting execution in release mode

       I have a TestStand sequence that calls a number of Vis. When I switch from development mode to the run-time engine, sometimes the TestStand sequence crashes at certain Vis. I then find that when I switch back to developement mode and open the vi,