Arrondir un chiffre


/ Published in: ActionScript 3
Save to your folder(s)

Arrondir un chiffre, à n chiffre après la virgule


Copy this code and paste it in your HTML
  1. function arrondi(pNum:Number,pNbApresVirgule:int):Number {
  2. return Math.round( pNum * Math.pow(10, pNbApresVirgule)) / Math.pow(10, pNbApresVirgule);
  3. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.