If the number is still in textual form you can use string operations:
string leftMostDigit = textualForm.Substring(0, 1);
Even faster is to grab the character:
char leftMostChar = textualForm[0];
int value = leftMostChar - '0';
if ( value < 0 || value > 9 ) { // Error }
If you are working with numbers then I would recommend converting
the item to an integer (trims the decimal locations) and then dividing by
10 until you are left with a value less than 10. Of course if the number is
3 digits, you can divide by 100 after validating the data is greater than
99 and less than 1000.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"Scott" <Sc***@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
How do I trim the left digit from a number? The user will input a number with
3 digit value and I need to trim the leftmost value from the number. A
typical value might be 123.4567 and I need to remove the 1 and use it's value
in another calculation.