This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copy of Excel's PMT function. | |
* Credit: http://stackoverflow.com/questions/2094967/excel-pmt-function-in-js | |
* | |
* @param rate_per_period The interest rate for the loan. | |
* @param number_of_payments The total number of payments for the loan in months. | |
* @param present_value The present value, or the total amount that a series of future payments is worth now; | |
* Also known as the principal. | |
* @param future_value The future value, or a cash balance you want to attain after the last payment is made. | |
* If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function populate_posts($form){ | |
foreach($form['fields'] as &$field){ | |
if($field['defaultValue'] != '{referer}') | |
continue; | |
//Check referrer field, if exists and HTTP referrer not set, try to fill it manually | |
if($field['defaultValue'] == '{referer}' && ! isset($_SERVER['HTTP_REFERER'])) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?<!\s)(@if\(.*\)|@elseif\(.*\)|@else|@endif)(?!\s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const prettyPrice = price => { | |
price = parseFloat(price); | |
price = formatMoney(price); | |
price = addDecimalSeperators(price); | |
price = price.replace(",00", ",-"); | |
return price; | |
}; | |
const formatMoney = (price, length, decimalDelimiter, sectionDelimiter) => { | |
let c, d, t, s, i, j; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper function to format price | |
* Replaces dots with commas, replaces trailing zeroes with ,- | |
* If there is only 1 trailing zero, adds another | |
* Adds ,- for rounded prices | |
* @param $price | |
* @return mixed|string | |
*/ | |
public static function prettyPrice($price) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Exception in {{ App::environment() }}-environment!</h1> | |
<strong>Code</strong>: {{ $exception->getCode() }}<br> | |
<strong>Exception message</strong>: {{ $exception->getMessage() }}<br> | |
<strong>Exception file</strong>: {{ $exception->getFile() }}<br> | |
<strong>Exception line</strong>: {{ $exception->getLine() }}<br> | |
<hr/> | |
<strong>INPUT vars:</strong><br> |