0
votes

Il lotus notes 6.5 i have some numeric field set to show only 2 number after comme (ex 2,25) but sometimes the complete number is for ex. 2,25387. How can i check via lotus notes script how many decimals have a numeber ? after that, how can i extract the numbers in a specific position or range ?

For example:

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.

how can i do this ?

1

1 Answers

3
votes

Just use getitemvalue...

Dim doc as NotesDocument
Dim dblNumber as Double

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

To get the doc:

In an agent that runs on selected documents:

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

In a button called from an open document:

Dim ws as New NotesUIWorkspace
Set doc = ws.CurrentDocument.Document

in dblValue you have the complete number. Use basic math to get the third and fourth digit after comma.