Get row/col from index/size

I’m working on some row/col functions for converting back and forth… Is there a simpler way to do this second function? Btw, these appear to be working correctly, but I am not 100% sure they are completely correct.

I’m converting back and forth between rows/cols and index/sizes. The tables are square. The math is done to match flash array’s and vectors which start at index 0.

public static function getTileIndexByRowCol(Col:int,Row:int,mapSize:int):int {
var Index:int = Row * mapSize + Col;
return Index;
}

public static function getRowColByTileIndex(Index:int,mapSize:int):Object {
var rowCol:Object = new Object();
if (Index > 0) {
var Num:Number = Index / mapSize;
var Rem:Number = Number("." + String(Num).split(".")[1]);
if (isNaN(Rem)) {
Rem = 0;
}
rowCol.Row = Math.floor(Num);
rowCol.Col = Math.round(Rem * mapSize);
} else {
rowCol.Row = 0;
rowCol.Col = 0;
}
return rowCol;
}