I am trying to insert some numbers into a powerpoint deck using the python-pptx module.
I have been able to insert values by converting all numbers to string as shown below. Could anyone advice if we can directly insert a number as an integer or float into the table.
slide = prs.slides.add_slide(prs.slide_layouts[1])
shapes = slide.shapes
shapes.title.text = 'Summary'
rows = 3
cols = 2
left = Inches(2.0)
top = Inches(2.0)
width = Inches(6.0)
height = Inches(0.8)
table = shapes.add_table(rows, cols, left, top, width, height).table
# set column widths
table.columns[0].width = Inches(4.0)
table.columns[1].width = Inches(4.0)
# write column headings
table.cell(0, 0).text = 'Name'
table.cell(0, 1).text = 'Value'
# write body cells
table.cell(1, 0).text = 'Total Sales'
table.cell(1, 1).text = str(count) <<- Want to insert the value of count directly without having to convert to a string