Re: Printf Problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

David Mosley wrote:
> 
> Hi
> I have a problem with printf I need to get this output
> 1.000.00
> I have tired this
> printf(1,"%d 5.2",exp[y])
> but I keep get the wrong output can someone help me thanks
> also does anyone have a function that uses a format like this
> printusing(#.###.##)
> that would be easer to understand thanks.
> 
David,

I'm a little confused.  Why would you want to take a numeric variable and
insert two decimal places?  

If I had to guess, it's probably not a number, right?  Is it more of an id
or some code, such as an item number or account number.  Here's a thought: 
if you number had three parts (#.###.##) and this is the format that it
should always be displayed in, why not try:

sequence code
code = sprintf("%d",exp[1]) & "." & sprintf("%d",exp[2]) & "." & sprintf("%d",
exp[3])


So in other words, you would split your "number" into three seperate 
sections.

Clear as mud?

Jonas Temple
http://www.yhti.net/~jktemple

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu