[VB.NET] Arrondi 2 décimales

Résolu/Fermé
Sandriine Messages postés 1255 Date d'inscription samedi 9 décembre 2006 Statut Membre Dernière intervention 18 août 2010 - 12 avril 2008 à 19:43
Whismeril Messages postés 19022 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 17 avril 2024 - 21 oct. 2015 à 08:58
Bonjour,
j'ai un nombre décimal que je voudrais arrondir à 2 chiffres après la virgule en VB.NET.

Je suppose qu'il y a une fonction faite pour cela?
A voir également:

2 réponses

Enax Messages postés 203 Date d'inscription lundi 11 février 2008 Statut Membre Dernière intervention 16 mars 2010 145
12 avril 2008 à 20:07
http://msconline.maconstate.edu/tutorials/VBNET/VBNET01/vbnet01-08.aspx

The FormatNumber() function returns a value formatted as a number. Its general format is shown below.

FormatNumber(value [, trailing digits] [, leading digit] [, parentheses] [, group digits])

value is any expression that produces a number;
trailing digits is an integer giving the number of digits following the decimal point; the default is rounding to 2 digits;
leading digit is True or False to indication whether a leading 0 is to appear before the decimal point for fractional values;
parentheses is True or False to indicate whether negative numbers should be displayed inside parentheses;
group digits is True or False to indicate whether numbers should be grouped between commas.
6