code to stipulate decimal places

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

code to stipulate decimal places

Post by steveh »

Good morning

We have some bespoke software that exports reports to Excel, our programmer is stuck on how to tell Excel to recognise the same amount of decimal places that he is sending, for example if he send 2500.00 it shows as 2500.

Can anybody tell me what the command is to tell it to do that (I think it is VB6 he is using)
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: code to stipulate decimal places

Post by HansV »

The number of decimal places is merely the way the number is displayed on screen and in printouts, Excel stores 2500 and 2500.00 exactly the same way.
If the programmer uses Automation to create the export workbook, he can set the NumberFormat property of cells the way he wants.
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: code to stipulate decimal places

Post by steveh »

Hi Hans

Thanks for the info. I guess that he did not know that and that is why it stays the same, I will let him know
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: code to stipulate decimal places

Post by ChrisGreaves »

steveh wrote:... for example if he send 2500.00 it shows as 2500.
Steve, Your programmer might be interested in this thread.
As I would be to hear from your programmer!
An expensive day out: Wallet and Grimace