Libreoffice Calc Basic 如何通过代码附加 2 位小数
Libreoffice Calc Basic How to append 2 decimal places by code
声明
Dim currDoc As Object
Dim currSheet As Object
Dim cell As Object
currDoc = ThisComponent
currSheet = currDoc.sheets(0)
逻辑
cell.Formula = cDbl(cell.Value)
期望输出
100,00
基于@JohnSUN 的评论:
只需为要格式化的单元格添加一行:
Cell.NumberFormat = 2
声明
Dim currDoc As Object
Dim currSheet As Object
Dim cell As Object
currDoc = ThisComponent
currSheet = currDoc.sheets(0)
逻辑
cell.Formula = cDbl(cell.Value)
期望输出
100,00
基于@JohnSUN 的评论: 只需为要格式化的单元格添加一行:
Cell.NumberFormat = 2