Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split a 'Decimal' in VB.NET

I am sure this is a very simple problem, but I am new to VB.NET, so I am having an issue with it.

I have a Decimal variable, and I need to split it into two separate variables, one containing the integer part, and one containing the fractional part.

For example, for x = 12.34 you would end up with a y = 12 and a z = 0.34.

Is there a nice built-in functions to do this or do I have to try and work it out manually?

like image 303
chillysapien Avatar asked Dec 12 '08 10:12

chillysapien


1 Answers

Simply:

DecimalNumber - Int(DecimalNumber)
like image 188
Ram Avatar answered Oct 25 '22 02:10

Ram