Lotus Notes:如何在逗号后的特定位置提取数字

时间:2015-09-18 09:13:04

标签: lotus-notes

Il lotus notes 6.5我有一些数字字段设置为仅在comme(ex 2,25)之后显示2个数字,但有时完整的数字是ex。 2,25387。 我怎么能通过莲花笔记脚本查看有多少小数有一个数字? 之后,我如何提取特定位置或范围内的数字?

例如:

in the field i see: 2,25 
the whole number is: 2,25387
using lotus notes script want to extract third and fourth number after comma, in this case 38.

我该怎么做?

1 个答案:

答案 0 :(得分:3)

只需使用getitemvalue ...

Dim doc as NotesDocument
Dim dblNumber as Double

Set doc = .... '- Somehow get the document
dblNumber = doc.GetItemValue( "NameOfNumericField" )(0)

获取文档:

在选定文档上运行的代理中:

Dim ses as New NotesSession
Dim db as NotesDatabase
Dim dc as NotesDocumentCollection
Dim doc as NotesDocument

Set db = ses.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument

在打开文档中调用的按钮中:

Dim ws as New NotesUIWorkspace
Set doc = ws.CurrentDocument.Document
在dblValue中

你有完整的号码。使用基本数学来获得逗号后的第三和第四位数。