Task

Take a   Natural Number   in a given base and return the sum of its digits:

   110         sums to   1
   123410   sums to   10
   fe16       sums to   29
   f0e16     sums to   29


function sumdigits(s) {
	a = ascii(strupper(s)):-48
	return(sum(a:-(a:>9)*7))
}
 
sumdigits("1")
  1
 
sumdigits("1234")
  10
 
sumdigits("fe")
  29
 
sumdigits("f0e")
  29
 
sumdigits(inbase(16, 254, 10))
  29