Solved

Formating of a Field

Posted on 2003-10-30
14
211 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now