Jump to content

gayanp

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gayanp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your replay i cant use echo 245-(int)getDiscount(); Discount can be change to decimal value.. i want value with 2 decimal places. please help me if you have better solution .. Actually i want to get understand why this happen.. check this ... it's return -0.00 it cant be -0.00 i want value 0.00. please help me.. function getDiscount() { $discount =0; $discount = 100; return (245/100) * $discount; } $y =245.00; $x =getDiscount(); echo number_format(($y-$x),2);
  2. Why it's print -2.8421709430404E-14; <?Php function getDiscount() { $discount = 100; return (245/100) * $discount; } echo 245-getDiscount(); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.