How can I convert a string to a number

Refactored the code to be more robust and not have side effects:

#import "@preview/oxifmt:0.2.1": strfmt
#show table.cell.where(y:0):set text(weight:"extrabold")
#let results = csv.decode("
Header1,Header2,Header3
A,B,231
C,D,2312
E,F,4546
G,H,6786
")
#let (header, ..data) = results
#table(
	inset: (x:1em,y:1em),
	columns: header.map(x=>1fr),
	stroke: none,
	fill: (x, y) => if calc.odd(y)  { rgb("#eee") },

	table.hline(),
	table.header(..header),
	table.hline(),

	..data.flatten().map(x=>{
    if x.contains(regex("\D")) == false{
        let ii = float(x)
        strfmt("{}", ii, fmt-thousands-separator: ",")
      }else{
        x
      }
  }),
	table.hline()
)