Solved

Formating of a Field

Posted on 2003-10-30
14
214 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

Industry Leaders: 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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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