Convert float to a numeric with 3 decimals

Hi,
How can I convert a float number to a numeric number with 3 decimals?
Tks,
Daniela

hi Daniela,
  Declare it as type <b>P</b>
i.e,
   Data : v_float type f,
          v_dec   type p decimals 3.
          v_dec = v_float.
    write : v_float, v_dec.
Regards,
Santosh

Similar Messages

  • Arithmetic Overflow error converting float to data type numeric

    Hi,
    Am facing strange issue,I have function which returns money datatype and assigning the return money value to float datatype in table.
    Error msg:
    Msg 8115, Level 16, State 6, Procedure GBCalcCatalogPriceNewV2, Line 204
    Arithmetic overflow error converting float to data type numeric.
    The statement has been terminated.
    Strange thing is the same stored procedure is working fine in production environment,but in the deveopment i see this error.Am scared if the same happens in the production environment.Please advice and advance
    thanks
    Regards
    RAj

    Strange thing is the same stored procedure is working fine in production environment,
    How could that be strange? This is an error that occurs depending on the data. Accidents that are waiting to happen will happen sooner or later.
    Then again, a development database may be more prone to such errors, because data that entered are completely out of whack with real life data. Still it is a warning sign. If you have some place where you convert data from float to numeric, you must consider
    the risk that the float value is outside the range for the numeric data type. How do you prevent that from happening? Maybe a CHECK constraint on the column? Of if the data origins from a money column, use a numeric data type with sufficient precision.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Function module to convert float value to data type 'dec'

    Hi experts,
      In a report i need to convert float value to the data type 'DEC'. How to convert it. Is there any function module for this conversion.
    Thanks and Regards,
    Vaibhav Tiwari.

    Hi ..
    We can do like this...
    Data : V_float type F value '12345.67'.
    Data: V_dec type P Decimals 2.
    Write:/ V_float exponent 0. "This will display it like Type P
    or
    Write V_float to V_dec EXPONENT 0.
    Write:/ V_dec.
    reward if Helpful.
    <b></b>

  • Convert float to 4 bytes array

    How can I convert float type to 4 byte array -
    not with strings but to exact binary representation.

    See the javadoc of Float.floatToIntBits. Converting an int to an array of 4 bytes is easy, so I will left it as an exercise.
    floatToIntBits
    public static int floatToIntBits(float value)Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout.
    Bit 31 (the bit that is selected by the mask 0x80000000) represents the sign of the floating-point number. Bits 30-23 (the bits that are selected by the mask 0x7f800000) represent the exponent. Bits 22-0 (the bits that are selected by the mask 0x007fffff) represent the significand (sometimes called the mantissa) of the floating-point number.
    If the argument is positive infinity, the result is 0x7f800000.
    If the argument is negative infinity, the result is 0xff800000.
    If the argument is NaN, the result is 0x7fc00000.
    In all cases, the result is an integer that, when given to the intBitsToFloat(int) method, will produce a floating-point value the same as the argument to floatToIntBits (except all NaN values are collapsed to a single "canonical" NaN value).
    Parameters:
    value - a floating-point number.
    Returns:
    the bits that represent the floating-point number.

  • Convert float to rational

    Hello,
    The TIFF tag header protocol requires a data type I am not really conversant with, the Rational Data type: http://en.wikipedia.org/wiki/Rational_data_type
    I need to convert double precision numbers to this data type, e.g. 24.5 needs to be a ratio of two integers: {49,2}. Is there an existing LabVIEW algorithm to perform this operation? All my NI searches keep resulting in Rational ClearCase or Rational Array interpolation. I seem to have found a lot of the theory behind this: http://stackoverflow.com/questions/95727/how-to-convert-floats-to-human-readable-fractions
    But, is this implemented in labVIEW already, or should I implement the above-referenced c-code?
    Thanks,
    Mello
    Data Science Automation
    CTA, CLA, CPI
    SHAZAM!
    Solved!
    Go to Solution.

    I was curious if there were other ways to do this and found that Scilab combined with the LabVIEW Gateway works quite well. The 'rat' function is available in Scilab; Scilab and the LabVIEW gateway were both easy to install...
    http://www.scilab.org/products/other/labview_gateway
    Message Edited by Phillip Brooks on 03-04-2010 08:29 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness
    Attachments:
    scilab_rat.JPG ‏46 KB

  • WithHold Tax with Decimals

    Hi,
    Is it possible to calculate the Withold Tax with value in Decimal places? i.e., If the base amount is 11111 and the withold tax % is 3 then the WT amount is 333.33 wherein SAP calculates it as 333 only. We had recently implemented B1 in Thailand and the requirement is that, the withold tax should be calculated with exact decimals and not rounded off.
    When I checked the Withold tax definition, there are only 2 options for rounding off, either to a lower amount or to a higher amount and there's no option to keep it as it is.
    Anybody has any solution?
    sriram

    Hi Adele,
    It has nothing to do with the decimal places.
    In the withold tax configuration, there are 2 types of rounding off methods available
    "commercial values" or "truncated AU" and you need to select any one of them.  commercial values setting, makes it to the next higher numeric and truncated au rounds it off to a lower value.
    There is a possibility that, at the time of carrying out the A/R or A/P transaction, the calculation can be done manually and we can enter the amount with decimals and SAP takes it as it is.  But when calculates it on it's own, then it doesn't.  That's why I wanted to know, whether anybody else is having this problem and whether they have any solution in place?
    sriram

  • I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    Your TV hasn't entered some odd picture in picture mode has it with  two 'inputs' side by side?
    AC

  • Adobe Acrobat XI pro version, Windows 7, running on iMac parallels, converting pdf to a pdf with reduced size is not possible, error: error in converting the file! What to do? Its a bit annoying not to be able to store pdf files in reduced size, any idea?

    Adobe Acrobat XI pro version, Windows 7, running on iMac parallels, converting pdf to a pdf with reduced size is not possible, error: error in converting the file! What to do? Its a bit annoying not to be able to store pdf files in reduced size, any idea?? Thanks, Jörg

    Hi Jorg ,
    Are you trying to reduce the file size with the "Reduced size PDF" in the save as other option.
    Give it a try if you haven't done it prior.
    Open that PDF>File>Save as Other>Reduced size PDF.
    If possible ,please share the snapshot of the error message with us so that we can have a look in order to assist you further.
    Regards
    Sukrit Dhingra

  • Converting Word (97-2003) docs with tables

    I have tried converting a few Word docs with tables using Acrobat.com. There is one small image in the upper right corner that in the converted doc stays in the same place so I know that is not the issue. What happens is that the converted document takes a nicely formatted document with tables and nested tables and turns it into a 4 page document and places all of the information in a larger table in the first column and looks nothing like the original with the exception of the header.
    I figured out that if I save the file to ODT that only the font gets changed (but this can be fix on my end by using a supported font). However, the person responsible for converting documents in the future after me neither has Acrobat pro or a way to save files in ODT format (they refuse to upgrade to Word 2007 for some reason so no ODT or Convert the PDF/XPS plug-in for them) so Acrobat.com is a sollution I was looking into to keep productivity going.
    If needed, I can send the original documents for anyone who would like to troubleshoot them and give feedback on what I could try so that they will work on Acrobat.com in ODT format.

    Thank you for your post. Would you please send along some sample files to us? Please reference this forum post, and I'll pass the files along to our QA folks for testing. Hopefully we'll be able to resolve the issue shortly! One more thought - you might try either creating your original document in Buzzword, then converting to PDF OR importing the word file to Buzzword, making any edits, and then converting to PDF. Could help. Let us know!
    Michelle

  • Difficulty converting file keeps coming up with "file failed to be converted using Adobe ExportPDF online

    Can't convert file keeps coming up with message "file failed to be converted using Adobe ExportPDF online.

    Hi Dude291,
    I'm sorry that you're having trouble with ExportPDF. Can you please tell me a bit more about what's going on, so we can get to the bottom of the issue?
    What browser are you using? Have you tried clearing the browser cache?
    Are you converting from within Reader, or directly via the ExportPDF website?
    Are you able to convert other files? Or is the error specific to this one file?
    How large or complex is  the file that you're trying to convert?
    Are you accessing ExportPDF from a networked computer that may have firewall/proxy settings that are limiting access to the Internet?
    I think that's good for starters. Please get back to us with some detail about the problem and we will see what we can do.
    Best,
    Sara

  • Is the software from Roxio that converts VHS to DVD compatible with Yosemite?

    Is the software from Roxio that converts VHS to DVD compatible with Yosemite?

    Check the Roxio web site.

  • Issues with Decimals

    I have an issue with decimals in calculation : -
    Data : G_SUM TYPE p DECIMALS 2.
       KOMV-KBETR = 2.00  (KBETR TYPE IS P(6) Decimal 2)
       WG_A650-ZZBILL_QUNT = 10.00 (ZZBILL_QUNT Type is P(7) Decimal 3)
            Loop at I_A650 into WG_A650.
                 G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).
            Endloop.
               XKWERT = G_SUM. (XKWERT Type is P(7) Decimal 2)
    Form the above calculation : - G_SUM should be 20.00
             But the result is : -  20000.00
    To aviod this i changed the declartion of G_SUM as below : -
    Data : G_SUM TYPE p DECIMALS 5.
    Now it is calculating correctly but i need to assign this value to a another field.
          Its data type is (TYPE p DECIMALS 2)
    Now the result is again changed to 20000.00
    Any sugesstion to fix this issue will be apprecaiated.
    Regards,
    Kittu

    Hi Florian Kemmer,
    Thank you for your quick response!
    It is my mistake, i could have explained in more efficient manner. 
    The below values are from Internal table only and it has only 1 record.
    KOMV-KBETR = 2.00    
       WG_A650-ZZBILL_QUNT = 10.00
    (G_SUM = G_SUM + ( KOMV-KBETR * WG_A650-ZZBILL_QUNT ).)
    After the above formula is executed it shoudl display the value as 20.00
    Due to issues with the decimals it is displaying as 20000.00
    And the declaration is not exactly done as described...It is just for understanding.
    KBETR --> is of type  P(6) Decimal 2.
    Any suggestion will be appreciated
    Regards,
    Kittu
    Edited by: Kittu on Mar 29, 2010 12:34 PM

  • APD-Issue with Decimals

    hi,
    I am using APD to get the report results as CSV file. I have restircted not to show the decimal places for the values in the report  but the file that is genarated always comes with two decimals.
    The business  does not wants the value with decimals.  I have looked at all the options to get this possible in APD.
    Please help with this issue. I am not good at ABAP and I may not be able to write a program.
    Regards,
    Raghu

    Hi;
    APD seeks to direct the base, then it makes sense to try to change the decimal places in the query, there is documentation that shows how to Creation of Key Figures with Higher Decimal Place Precision (https://service.sap.com/sap/support/notes/460652)
    Sá Freire
    Edited by: Luiz André Sá Freire on Feb 2, 2011 4:35 PM

  • Convert PDF Document to PDF with Spot Color

    I want to convert a regular PDF document with RGB/CMYK color profile to one with Spot color. Can this be done using Acrobat X Pro, if so How?

    Hi Steve
    I am still working on the process to automate the conversion of PDF file with RGB color profile to Spot.
    I am nearly there, here is the method...
    1. Have a prefight profile with the spot color fixes. For now I put in 10 colors.
    2. Wrote a Javascript that will invoke the preflight profile
    3. Cretated an application (AutoSpotFix) in VC++ and Acrobat SDK that will open the document and assign the javascript function to 'WillSave' document action. The AutoSpotFix will then trigger the save on the document.
    Java script had to be involved because SDK cannot invoke the preflight profile.
    Now my problem is the document can contain any spot color, I need to
    a) Either put in the thousands of spot color into my preflight profile, which will take days to do. Or I can create a preflight profile file (*.kfp) and load it, which is an XML file.
    b) Dynamically load the preflight profile file with the few current colors, for which I need to dynamically create the preflifgt profile.
    Either way I have to create the *.kfp file, Is there a way to create the Preflight profile file?

  • Does Microsoft support disks which have been converted from MBR to GPT with third-party tools?

    Before opening a ticket with Microsoft to get the official response, does Microsoft support disks which have been converted from MBR to GPT with third-party tools?
    We have various disks on Windows Server 2008 R2 fileserver cluster that are all MBR with various mount points added to overcome the 2TB limitation on MBR disks.  Due to the time involved in physically moving the 30Tb+ of data to GPT disks, I would
    like to investigate the option of a lossless conversion tool. Does anybody have any experience of these in production environments that could comment?
    Any advice and details of experiences would be really appreciated!
    CRM Advisor

    Hi,
    Besed on my research, Microsoft supports a fileserver cluster if the disks have been converted from MBR to GPT using a third-party tool.
    For more detailed information, please refer to the links below:
    Convert MBR to GPT
    https://social.technet.microsoft.com/Forums/en-US/3007346f-cf7b-4089-9628-36d394da8240/convert-mbr-to-gpt
    Change a Master Boot Record Disk into a GUID Partition Table Disk
    http://technet.microsoft.com/en-us/library/cc725671.aspx
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

Maybe you are looking for