• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

keeping just one decimal after a dot

Hi Actually I am Exporting data to Excel and i need to show the data as 105.2% while in excel it shows as 105.20%,  The percentage sign i am adding manually, how can i remove the last zero from the data i tried using numberformat in Cf page but no workaround, please guide

thanks
0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 6
  • 4
  • 2
  • +1
1 Solution
 
TeargasCommented:
do you have excel 2010?

for excel 2010 and i think in other versions it should be similar you just have to right click on the cell -> formating -> numbers -> choose percentage -> on the right you can click and choose the digits e.g 1.

hope it helped
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i have excel 2007,
0
 
TeargasCommented:
in excel 2007 you should have the same command, if you have the standard view you just have in the 2nd line, where you can select your font a bit right something that look like this

<-.0
.00

and

'00
->0

with that buttons you can raise and lower the decimals
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i am exporting from coldfusion to excel, i am not working wwithin excel
0
 
gdemariaCommented:
Can you show the line of coldfusion code you're using to write this value, I can help you modify it..
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:

i am just using as #mydata# inside the <cfsavecontent>

and then i am am writing this in excel.

on my screen it appears as 0.0% or 154.1%

in excel i want the format to same, but i am not getting it, just guide
0
 
Dave BaldwinFixer of ProblemsCommented:
You are seeing the 'default formatting' in Excel (and Libreoffice).  If you type 154.1% into a cell in Excel and press enter, it will convert it to 154.10%.  Unless you can find a way to change the default formatting, you can't change that.
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Then Guide me how to fix it
0
 
Dave BaldwinFixer of ProblemsCommented:
I don't believe you can fix it outside of Excel.  CSV and HTML imports are subject to the default formatting rules and those rules can't be changed outside the program.  You can't even force it to be text without adding a letter to it.
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
still there might we give it a try using some removechars or listlast or right function, well just a thought actually i tried it but may be i was doing wrong way

Any CSS implementation
0
 
Dave BaldwinFixer of ProblemsCommented:
Excel will ignore standard CSS but is supposed to respond to 'mso' (MicroSoft Office) formatting.  Here http://cosicimiento.blogspot.com/2008/11/styling-excel-cells-with-mso-number.html is a list of some commands.  Here's http://agoric.com/sources/software/htmltoExcel some more info.
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now