03.0 digit number to 0, 3, 0

I've been using this code to turn a 03.0 digit number into 0, 3 and & 0, but to be honest it's pretty pitiful. Given the commands I can use in the arduino language I can't seem to find a better, faster method of doing it...

(it only works on numbers up to 50.1)

void numb2digit(int number) { 
  tens = 0;
  ones = 0;
  tenths = 0;

  switch(number){ // Find the tenths place digit. Lots of testing here...
    case 1:   case 11:  case 21:  case 31:  case 41:  case 51:  case 61:  case 71:  case 81:  case 91: 
    case 101: case 111: case 121: case 131: case 141: case 151: case 161: case 171: case 181: case 191:  
    case 201: case 211: case 221: case 231: case 241: case 251: case 261: case 271: case 281: case 291:   
    case 301: case 311: case 321: case 331: case 341: case 351: case 361: case 371: case 381: case 391: 
    case 401: case 411: case 421: case 431: case 441: case 451: case 461: case 471: case 481: case 491: 
    case 501: tenths = 1; 
    break;

    case 2:   case 12:  case 22:  case 32:  case 42:  case 52:  case 62:  case 72:  case 82:  case 92: 
    case 102: case 112: case 122: case 132: case 142: case 152: case 162: case 172: case 182: case 192: 
    case 202: case 212: case 222: case 232: case 242: case 252: case 262: case 272: case 282: case 292: 
    case 302: case 312: case 322: case 332: case 342: case 352: case 362: case 372: case 382: case 392: 
    case 402: case 412: case 422: case 432: case 442: case 452: case 462: case 472: case 482: case 492: 
    case 502: tenths = 2; 
    break; 

    case 3:   case 13:  case 23:  case 33:  case 43:  case 53:  case 63:  case 73:  case 83:  case 93: 
    case 103: case 113: case 123: case 133: case 143: case 153: case 163: case 173: case 183: case 193: 
    case 203: case 213: case 223: case 233: case 243: case 253: case 263: case 273: case 283: case 293: 
    case 303: case 313: case 323: case 333: case 343: case 353: case 363: case 373: case 383: case 393: 
    case 403: case 413: case 423: case 433: case 443: case 453: case 463: case 473: case 483: case 493: 
    case 503: tenths = 3; 
    break;
   
    case 4:   case 14:  case 24:  case 34:  case 44:  case 54:  case 64:  case 74:  case 84:  case 94: 
    case 104: case 114: case 124: case 134: case 144: case 154: case 164: case 174: case 184: case 194: 
    case 204: case 214: case 224: case 234: case 244: case 254: case 264: case 274: case 284: case 294: 
    case 304: case 314: case 324: case 334: case 344: case 354: case 364: case 374: case 384: case 394: 
    case 404: case 414: case 424: case 434: case 444: case 454: case 464: case 474: case 484: case 494: 
    case 504: tenths = 4; 
    break;
   
    case 5:   case 15:  case 25:  case 35:  case 45:  case 55:  case 65:  case 75:  case 85:  case 95: 
    case 105: case 115: case 125: case 135: case 145: case 155: case 165: case 175: case 185: case 195: 
    case 205: case 215: case 225: case 235: case 245: case 255: case 265: case 275: case 285: case 295: 
    case 305: case 315: case 325: case 335: case 345: case 355: case 365: case 375: case 385: case 395: 
    case 405: case 415: case 425: case 435: case 445: case 455: case 465: case 475: case 485: case 495: 
    case 505: tenths = 5; 
    break;
  
    case 6:   case 16:  case 26:  case 36:  case 46:  case 56:  case 66:  case 76:  case 86:  case 96: 
    case 106: case 116: case 126: case 136: case 146: case 156: case 166: case 176: case 186: case 196: 
    case 206: case 216: case 226: case 236: case 246: case 256: case 266: case 276: case 286: case 296: 
    case 306: case 316: case 326: case 336: case 346: case 356: case 366: case 376: case 386: case 396: 
    case 406: case 416: case 426: case 436: case 446: case 456: case 466: case 476: case 486: case 496: 
    case 506: tenths = 6;
    break;
   
    case 7:   case 17:  case 27:  case 37:  case 47:  case 57:  case 67:  case 77:  case 87:  case 97: 
    case 107: case 117: case 127: case 137: case 147: case 157: case 167: case 177: case 187: case 197: 
    case 207: case 217: case 227: case 237: case 247: case 257: case 267: case 277: case 287: case 297: 
    case 307: case 317: case 327: case 337: case 347: case 357: case 367: case 377: case 387: case 397: 
    case 407: case 417: case 427: case 437: case 447: case 457: case 467: case 477: case 487: case 497: 
    case 507: tenths = 7;
    break;
  
    case 8:   case 18:  case 28:  case 38:  case 48:  case 58:  case 68:  case 78:  case 88:  case 98: 
    case 108: case 118: case 128: case 138: case 148: case 158: case 168: case 178: case 188: case 198: 
    case 208: case 218: case 228: case 238: case 248: case 258: case 268: case 278: case 288: case 298: 
    case 308: case 318: case 328: case 338: case 348: case 358: case 368: case 378: case 388: case 398: 
    case 408: case 418: case 428: case 438: case 448: case 458: case 468: case 478: case 488: case 498: 
    case 508: tenths = 8;
    break;

    case 9:   case 19:  case 29:  case 39:  case 49:  case 59:  case 69:  case 79:  case 89:  case 99: 
    case 109: case 119: case 129: case 139: case 149: case 159: case 169: case 179: case 189: case 199: 
    case 209: case 219: case 229: case 239: case 249: case 259: case 269: case 279: case 289: case 299: 
    case 309: case 319: case 329: case 339: case 349: case 359: case 369: case 379: case 389: case 399: 
    case 409: case 419: case 429: case 439: case 449: case 459: case 469: case 479: case 489: case 499: 
    case 509: tenths = 9;
    break;  
  };
  
switch (number / 10){ Find the ones place digit.
    case 1: case 11: case 21: case 31: case 41: case 51: case 61: case 71: case 81: case 91: 
    ones = 1; break;
    
    case 2: case 12: case 22: case 32: case 42: case 52: case 62: case 72: case 82: case 92: 
    ones = 2; break;

    case 3: case 13: case 23: case 33: case 43: case 53: case 63: case 73: case 83: case 93: 
    ones = 3; break;

    case 4: case 14: case 24: case 34: case 44: case 54: case 64: case 74: case 84: case 94: 
    ones = 4; break;

    case 5: case 15: case 25: case 35: case 45: case 55: case 65: case 75: case 85: case 95: 
    ones = 5; break;
  
    case 6: case 16: case 26: case 36: case 46: case 56: case 66: case 76: case 86: case 96: 
    ones = 6; break;
    
    case 7: case 17: case 27: case 37: case 47: case 57: case 67: case 77: case 87: case 97: 
    ones = 7; break;
    
    case 8: case 18: case 28: case 38: case 48: case 58: case 68: case 78: case 88: case 98: 
    ones = 8; break;
  
    case 9: case 19: case 29: case 39: case 49: case 59: case 69: case 79: case 89: case 99:
    ones = 9; break;
  }; 

  switch (number / 100){ // Now find the tens place.
    case 1: tens = 1; break;
    case 2: tens = 2; break;
    case 3: tens = 3; break;
    case 4: tens = 4; break;
    case 5: tens = 5; break;
    case 6: tens = 6; break;
    case 7: tens = 7; break;
    case 8: tens = 8; break;
    case 9: tens = 9; break;
  };
};

Here's a slightly shorter version:

void numb2digit(int number)
{ 
  tens = number/100;
  ones = (number/10)%10;
  tenths = number%10;
}

...I always forget about the modulo.