Solved

Formating of a Field

Posted on 2003-10-30
14
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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