How to get rounded off value - Crystal Report C#

Answered How to get rounded off value - Crystal Report C#

  • Tuesday, October 16, 2012 8:01 AM
     
     

    Hello Friends,

    Need your help on the below.

    I am working on a C# Project where in I am using Crystal report to print a TAX INVOICE.

    I want to know how can we show rounded off value.

    Eg.

    Bill Amount is Rs. 3000.34

    Tax Amount is Rs. 345.56

    Total Bill will be Rs. 3345.90

    Now here i know how to round off the Total Bill Amount but i need to show 0.90 paisa which i will be rounding off on the bill so can you help me on that please.

    How do i get the rounded off value ( which is 0.34 + 0.56 = 0.90 paisa ) in this case.

    Regards,

    Mac

All Replies

  • Tuesday, October 16, 2012 10:41 AM
     
     Answered

    If you'd ask for Small Basic, I'd say:

    leftover1 = Bill - math.floor(bill)

    leftover2 = Tax - math.floor(tax)

    roundedOffValue = leftover1 + leftover2

    ???

    Maybe in C# you have to use "int" instead of math.floor()


    I changed my password to "incorrect", so whenever I forgot what it was, the computer will remind me: "Password is incorrect"


  • Wednesday, October 17, 2012 7:36 AM
     
     

    Damn !!!

    It was so simple....I think i just needed a extra head to think :)

    Thanks Rene !