libreofficeopenoffice.orgbasiclibreoffice-basicopenoffice-basic

Libreoffice Calc Basic How to append 2 decimal places by code


Declaration

Dim currDoc As Object
Dim currSheet As Object
Dim cell As Object  
currDoc = ThisComponent
currSheet = currDoc.sheets(0)

Logic

cell.Formula = cDbl(cell.Value)

Desired Output
100,00


Solution

  • based on @JohnSUN 's comment: Just add one line for your cell to be formatted:

    Cell.NumberFormat = 2 
    

    Table for all Numberformats on page 189