Version Française
( Blog «java»)

Calculateur de versements hypothécaires canadien

Written by David Grégoire | 16 November 2010 | 0

Voilà:

function paiements(AnnualIntRate, Period, Amount, PPay){
PrValue = Amount;
IntRate = (Math.pow((1+AnnualIntRate/2),(2/PPay)) - 1)

Pa = (PrValue * IntRate) / (1 - Math.pow (1 + IntRate, - (Period * PPay)))
return Pa;
}

aux deux semaines
console.log(paiements(0.045, 25, 325000, 24));

au mois
console.log(paiements(0.045, 25, 325000, 12));

accéléré deux semaines
console.log(paiements(0.045, 25, 325000, 26));

par semaine
console.log(paiements(0.045, 25, 325000, 52));

Tags: calculatrice hypothécaire, hypothèque, java, versements hypothécaires,

Category: Free stuff

Share:

Typeface has a bug with word boundaries and special caracters(Unicode) - IE

Written by David Grégoire | 23 March 2010 | 8

We use regularly Typeface to apply a particular font to text on websites.

A bug happened: the regex engine splits the word "français" in "franç" and "ais". The split happened when the engine meet an accented caracter, UTF8 or Unicode.

The effect was invisible in many browsers, but in Internet Explorer, a space was inserted because the script created two distinct markups.

There is a solution! You just have to change line #289 of typeface.js to this:

var words = text.split(/\b(?=\X)/);

Et l'affaire est ketchup !

Credits: http://twitter.com/tousdan

Tags: accents, caracteres spéciaux, java, regex, typeface, unicode,

Category: Free stuff

Share: