Wednesday, January 5, 2011

Suffix to cast numeric literal numbers to decimal value

Usually, i do decimal.parse(numeric value) to parse numbers to decimal. But there's a shortcut way to do this. Just append a suffix m or M to the numeric value.
Code:
decimal balanceBank = 50000.5m;  
decimal balanceBank = 50000.5M; 
Source: MSDN

0 comments:

Post a Comment