IND_money_format($value) ; } public function getAccruedInterestAttribute($value) { return $this->IND_money_format($value) ; } public function getPortfolioValueAttribute($value) { return $this->IND_money_format($value) ; } public function getNetPrincipalInvestmentAttribute($value) { return $this->IND_money_format($value) ; } public function getAnnualisedReturnAttribute($value) { return $this->IND_money_format($value) ; } //Faircent - Accessor public function getTotalValueAttribute($value) { return $this->IND_money_format($value) ; } public function getInvestmentAmountAttribute($value) { return $this->IND_money_format($value) ; } public function getAllTimeAmountInvestedAttribute($value) { return $this->IND_money_format($value) ; } public function getInterestAccruedAttribute($value) { return $this->IND_money_format($value) ; } public function getPrincipalRedemptionAttribute($value) { return $this->IND_money_format($value) ; } public function getNetInterestRedemptionAttribute($value) { return $this->IND_money_format($value) ; } public function getEscrowBalanceAttribute($value) { return $this->IND_money_format($value) ; } //Finance Peer - Accessor public function getAllTimeInvestmentAddedAttribute($value) { return $this->IND_money_format($value) ; } public function getTotalActiveInvestmentAttribute($value) { return $this->IND_money_format($value) ; } public function getNextExpectedValueAtMaturityAttribute($value) { return $this->IND_money_format($value) ; } public function getNetAssetValueAttribute($value) { return $this->IND_money_format($value) ; } public function getAmountWithdrawnAttribute($value) { return $this->IND_money_format($value) ; } public function getInterestPaidoutAttribute($value) { return $this->IND_money_format($value) ; } public function getAbsoluteReturnInRsAttribute($value) { return $this->IND_money_format($value) ; } function IND_money_format($number) { $decimal = (string)($number - floor($number)); $money = floor($number); $length = strlen($money); $delimiter = ''; $money = strrev($money); for ($i = 0; $i < $length; $i++) { if (($i == 3 || ($i > 3 && ($i - 1) % 2 == 0)) && $i != $length) { $delimiter .= ','; } $delimiter .= $money[$i]; } $result = strrev($delimiter); $decimal = preg_replace("/0\./i", ".", $decimal); $decimal = substr($decimal, 0, 3); if ($decimal != '0') { $result = $result . $decimal; } return '₹ ' . $result; } }