1<?xml version="1.0" encoding="UTF-8"?> 2<helpdocument version="1.0"> 3 4<!-- 5*********************************************************************** 6 * 7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8 * 9 * Copyright 2000, 2010 Oracle and/or its affiliates. 10 * 11 * OpenOffice.org - a multi-platform office productivity suite 12 * 13 * This file is part of OpenOffice.org. 14 * 15 * OpenOffice.org is free software: you can redistribute it and/or modify 16 * it under the terms of the GNU Lesser General Public License version 3 17 * only, as published by the Free Software Foundation. 18 * 19 * OpenOffice.org is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU Lesser General Public License version 3 for more details 23 * (a copy is included in the LICENSE file that accompanied this code). 24 * 25 * You should have received a copy of the GNU Lesser General Public License 26 * version 3 along with OpenOffice.org. If not, see 27 * <http://www.openoffice.org/license.html> 28 * for a copy of the LGPLv3 License. 29 * 30 ************************************************************************ 31 --> 32 33 34<meta> 35 <topic id="textscalcguideinteger_leading_zeroxml" indexer="include" status="PUBLISH"> 36 <title xml-lang="en-US" id="tit">Entering a Number with Leading Zeros</title> 37 <filename>/text/scalc/guide/integer_leading_zero.xhp</filename> 38 </topic> 39 </meta> 40 <body> 41<bookmark xml-lang="en-US" branch="index" id="bm_id3147560"><bookmark_value>zero values; entering leading zeros</bookmark_value> 42 <bookmark_value>numbers; with leading zeros</bookmark_value> 43 <bookmark_value>leading zeros</bookmark_value> 44 <bookmark_value>integers with leading zeros</bookmark_value> 45 <bookmark_value>cells; changing text/number formats</bookmark_value> 46 <bookmark_value>formats; changing text/number</bookmark_value> 47 <bookmark_value>text in cells; changing to numbers</bookmark_value> 48 <bookmark_value>converting;text with leading zeros, into numbers</bookmark_value> 49</bookmark><comment>UFI: inserted "converting;text to numbers"</comment><comment>mw changed "converting;" and deleted "numbers,changing..."</comment> 50<paragraph xml-lang="en-US" id="hd_id3147560" role="heading" level="1" l10n="U" 51 oldref="67"><variable id="integer_leading_zero"><link href="text/scalc/guide/integer_leading_zero.xhp" name="Entering a Number with Leading Zeros">Entering a Number with Leading Zeros</link> 52</variable></paragraph> 53 <section id="inttext"> 54 <paragraph xml-lang="en-US" id="par_id3153194" role="paragraph" l10n="U" oldref="55">There are various ways to enter integers starting with a zero:</paragraph> 55 <list type="unordered"> 56 <listitem> 57 <paragraph xml-lang="en-US" id="par_id3146119" role="listitem" l10n="U" oldref="56">Enter the number as text. The easiest way is to enter the number starting with an apostrophe (for example, <item type="input">'0987</item>). The apostrophe will not appear in the cell, and the number will be formatted as text. Because it is in text format, however, you cannot calculate with this number.</paragraph> 58 </listitem> 59 <listitem> 60 <paragraph xml-lang="en-US" id="par_id3154013" role="listitem" l10n="U" oldref="57">Format a cell with a number format such as <item type="input">\0000</item>. This format can be assigned in the <emph>Format code</emph> field under the <emph>Format - Cells - Numbers</emph> tab, and defines the cell display as "always put a zero first and then the integer, having at least three places, and filled with zeros at the left if less than three digits".</paragraph> 61 </listitem> 62 </list> 63 <paragraph xml-lang="en-US" id="par_id3150011" role="paragraph" l10n="E" oldref="66" 64 localize="false"/> 65 <paragraph xml-lang="en-US" id="par_id3153158" role="paragraph" l10n="U" oldref="58">If you want to apply a numerical format to a column of numbers in text format (for example, text "000123" becomes number "123"), do the following:</paragraph> 66 <list type="ordered"> 67 <listitem> 68 <paragraph xml-lang="en-US" id="par_id3149377" role="listitem" l10n="U" oldref="59">Select the column in which the digits are found in text format. Set the cell format in that column as "Number".</paragraph> 69 </listitem> 70 <listitem> 71 <paragraph xml-lang="en-US" id="par_id3154944" role="listitem" l10n="U" oldref="60">Choose <emph>Edit - Find & Replace</emph> 72 </paragraph> 73 </listitem> 74 <listitem> 75 <paragraph xml-lang="en-US" id="par_id3154510" role="listitem" l10n="U" oldref="61">In the <emph>Search for</emph> box, enter <item type="input">^[0-9]</item> 76 </paragraph> 77 </listitem> 78 <listitem> 79 <paragraph xml-lang="en-US" id="par_id3155068" role="listitem" l10n="U" oldref="62">In the <emph>Replace with</emph> box, enter <item type="input">&</item> 80 </paragraph> 81 </listitem> 82 <listitem> 83 <paragraph xml-lang="en-US" id="par_id3149018" role="listitem" l10n="U" oldref="63">Check <emph>Regular expressions</emph> 84 </paragraph> 85 </listitem> 86 <listitem> 87 <paragraph xml-lang="en-US" id="par_id3156382" role="listitem" l10n="U" oldref="64">Check <emph>Current selection only</emph> 88 </paragraph> 89 </listitem> 90 <listitem> 91 <paragraph xml-lang="en-US" id="par_id3146916" role="listitem" l10n="U" oldref="65">Click <emph>Replace All</emph> 92 </paragraph> 93 </listitem> 94 </list> 95 </section> 96 <section id="relatedtopics"> 97 <embed href="text/scalc/guide/text_numbers.xhp#text_numbers"/> 98 <embed href="text/scalc/guide/format_value.xhp#format_value"/> 99 </section> 100 </body> 101</helpdocument>