Solved

Formating of a Field

Posted on 2003-10-30
14
213 Views
Last Modified: 2013-12-18
Im trying to format a field and I use the code below.

mac = Format$(doc.cash(0), "###,###,##0.00")

For example, the value of the field doc.cash(0) = 29454.7, the value of mac should be 29,454.70, but its not working

Help!!
0
Comment
Question by:makuletski
  • 3
  • 3
  • 2
  • +4
14 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 9656082
What is returned to mac?
Did you DIM mac as string?
Did you specify a thousand-separator in your OS (I assume you did for decimals)? If you didn't ("" is an option!) it won't show!
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 9656304
What is not working ?

You can try it out by putting this in a button

Sub Click(Source As Button)
      Msgbox Format$( 24754.7, "###,###,##0.00")
End Sub

and

Sub Click(Source As Button)
      Msgbox Format$( "24754.7", "###,###,##0.00")
End Sub

If that gives the right result, there may be something 'wrong' with the input.  If your field is a text field, and not a number, you should be aware of the international settings ( eg.  decimal delimiter, thousands separator).  

cheers,

Tom
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 9657454
500 for formatting ?  Dont you think too much guys ?  Share it with me...
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 31

Expert Comment

by:qwaletee
ID: 9657511
Arun,

If you walk over to makuletski's desk, and implement either CRAK's or Bozzie's suggestions, then I'm sure they would be glad to share the points.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9657915
I believe you are trying to set a field value called mac !?!? Right ?

For that use this code

Dim ws as new NotesUIworkspace
dim note as NotesDocument
set note = ws.CurrentDocument.Document
mac = Format$(doc.cash(0), "###,###,##0.00")
note.Mac = mac


~Hemanth
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9658865
You know, in all this, I just realized: makuletski never really told us what's wrong.  What are theresults? How does he know it is wrong? Where is the mac variable's value used?
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9660682
Exactly! I still don't know what result arrived at mac.

This could have been solved so easy (and more important for me as 1st respondent: quietly... )! I was hoping to reach the premium services threshold. Don't you all grant me continued subscription?

Arun, you're right. It is a very generous donation, but at least some of us try to EARN these points. Will you ever change?  ;-))

Makuletski, what are you trying to archieve anyway? Hemanths suggestion writes the value (formatted) to a field. You could do a similar thing by just using the (numerical) fields properties (2nd tab). Perhaps there's an easier solution for what you try to do!
0
 

Author Comment

by:makuletski
ID: 9669148
actually guys, i assigned 500 points for the questions coz i need it the same day i posted it. however i found out eventually what the problem is....this is the next line in my code..

mac = Format$(doc.cash(0), "###,###,##0.00")
param1 = Cstr(Abs(mac)

what i did was delete the Abs function and it worked out ok.

about the points, will it be ok if i just split the points to each one of u since all of you took the time to asnwer my query? (and so the next time i ask, you guys can help me asap! lol ;) )
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9684733
go ahead.  or just get a refund.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9685229
I agree with qwaletee
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9687160
If you have noticed my code you would have got that clue. I din't make any changes to the format as you did before using that value. So it is always better if you give us block of code for review.. so ball is in your court I can accept points or you can have the points I don't have any objection
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12462406
PAQed - no points refunded (of 500)

modulo
Community Support Moderator
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question