Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Number problems

jitujitu Member Posts: 1
I had made a field with number datatype. While calculating fine using procedure the result displayed is
for eg.
if 5*10 it shows the output 49.999999 whereas while inserting into table it insert it as 50.

why is it so?.......

Thanks for your co-operation in advance.

Comments

  • MorianoMoriano Member Posts: 11
    : I had made a field with number datatype. While calculating fine using procedure the result displayed is
    : for eg.
    : if 5*10 it shows the output 49.999999 whereas while inserting into table it insert it as 50.
    :
    : why is it so?.......
    :
    : Thanks for your co-operation in advance.
    :
    If you don't especify the precision of the field, it can occur this because the way that Oracle mades the operations (i don't know exactly how oracle does it, but i get the same "precision error" lot of times.

    You can evade this by two ways:

    setting the precision of the field like A NUMBER(38,2)

    or rounding the mathematic operation round(5*10)

    Hope this helps
  • Shawn CarterShawn Carter Member Posts: 0

    _____ \ http://forcoder.org \ free video tutorials and ebooks about // C, R, Ruby, PHP, Objective-C, MATLAB, Perl, C++, PL/SQL, Python, Visual Basic, C#, JavaScript, Java, Go, Visual Basic .NET, Assembly, Swift, Delphi, Scratch Scheme, SAS, VBScript, Prolog, ML, Erlang, Scala, Lua, Crystal, Bash, Awk, ABAP, Fortran, Apex, Julia, Rust, Transact-SQL, LabVIEW, Ada, Logo, D, Lisp, Hack, F#, Kotlin, Clojure, Dart, Alice, COBOL, FoxPro // ___

Sign In or Register to comment.