1*b1cdbd2cSJim Jagielski<?xml version="1.0" encoding="UTF-8"?> 2*b1cdbd2cSJim Jagielski<helpdocument version="1.0"> 3*b1cdbd2cSJim Jagielski 4*b1cdbd2cSJim Jagielski<!--*********************************************************** 5*b1cdbd2cSJim Jagielski * 6*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 7*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 8*b1cdbd2cSJim Jagielski * distributed with this work for additional information 9*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 10*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 11*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 12*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 13*b1cdbd2cSJim Jagielski * 14*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 15*b1cdbd2cSJim Jagielski * 16*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 17*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 18*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 20*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 21*b1cdbd2cSJim Jagielski * under the License. 22*b1cdbd2cSJim Jagielski * 23*b1cdbd2cSJim Jagielski ***********************************************************--> 24*b1cdbd2cSJim Jagielski 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski 28*b1cdbd2cSJim Jagielski<meta> 29*b1cdbd2cSJim Jagielski <topic id="textscalcguideinteger_leading_zeroxml" indexer="include" status="PUBLISH"> 30*b1cdbd2cSJim Jagielski <title xml-lang="en-US" id="tit">Entering a Number with Leading Zeros</title> 31*b1cdbd2cSJim Jagielski <filename>/text/scalc/guide/integer_leading_zero.xhp</filename> 32*b1cdbd2cSJim Jagielski </topic> 33*b1cdbd2cSJim Jagielski </meta> 34*b1cdbd2cSJim Jagielski <body> 35*b1cdbd2cSJim Jagielski<bookmark xml-lang="en-US" branch="index" id="bm_id3147560"><bookmark_value>zero values; entering leading zeros</bookmark_value> 36*b1cdbd2cSJim Jagielski <bookmark_value>numbers; with leading zeros</bookmark_value> 37*b1cdbd2cSJim Jagielski <bookmark_value>leading zeros</bookmark_value> 38*b1cdbd2cSJim Jagielski <bookmark_value>integers with leading zeros</bookmark_value> 39*b1cdbd2cSJim Jagielski <bookmark_value>cells; changing text/number formats</bookmark_value> 40*b1cdbd2cSJim Jagielski <bookmark_value>formats; changing text/number</bookmark_value> 41*b1cdbd2cSJim Jagielski <bookmark_value>text in cells; changing to numbers</bookmark_value> 42*b1cdbd2cSJim Jagielski <bookmark_value>converting;text with leading zeros, into numbers</bookmark_value> 43*b1cdbd2cSJim Jagielski</bookmark><comment>UFI: inserted "converting;text to numbers"</comment><comment>mw changed "converting;" and deleted "numbers,changing..."</comment> 44*b1cdbd2cSJim Jagielski<paragraph xml-lang="en-US" id="hd_id3147560" role="heading" level="1" l10n="U" 45*b1cdbd2cSJim Jagielski 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> 46*b1cdbd2cSJim Jagielski</variable></paragraph> 47*b1cdbd2cSJim Jagielski <section id="inttext"> 48*b1cdbd2cSJim Jagielski <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> 49*b1cdbd2cSJim Jagielski <list type="unordered"> 50*b1cdbd2cSJim Jagielski <listitem> 51*b1cdbd2cSJim Jagielski <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> 52*b1cdbd2cSJim Jagielski </listitem> 53*b1cdbd2cSJim Jagielski <listitem> 54*b1cdbd2cSJim Jagielski <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> 55*b1cdbd2cSJim Jagielski </listitem> 56*b1cdbd2cSJim Jagielski </list> 57*b1cdbd2cSJim Jagielski <paragraph xml-lang="en-US" id="par_id3150011" role="paragraph" l10n="E" oldref="66" 58*b1cdbd2cSJim Jagielski localize="false"/> 59*b1cdbd2cSJim Jagielski <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> 60*b1cdbd2cSJim Jagielski <list type="ordered"> 61*b1cdbd2cSJim Jagielski <listitem> 62*b1cdbd2cSJim Jagielski <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> 63*b1cdbd2cSJim Jagielski </listitem> 64*b1cdbd2cSJim Jagielski <listitem> 65*b1cdbd2cSJim Jagielski <paragraph xml-lang="en-US" id="par_id3154944" role="listitem" l10n="U" oldref="60">Choose <emph>Edit - Find & Replace</emph> 66*b1cdbd2cSJim Jagielski </paragraph> 67*b1cdbd2cSJim Jagielski </listitem> 68*b1cdbd2cSJim Jagielski <listitem> 69*b1cdbd2cSJim Jagielski <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> 70*b1cdbd2cSJim Jagielski </paragraph> 71*b1cdbd2cSJim Jagielski </listitem> 72*b1cdbd2cSJim Jagielski <listitem> 73*b1cdbd2cSJim Jagielski <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> 74*b1cdbd2cSJim Jagielski </paragraph> 75*b1cdbd2cSJim Jagielski </listitem> 76*b1cdbd2cSJim Jagielski <listitem> 77*b1cdbd2cSJim Jagielski <paragraph xml-lang="en-US" id="par_id3149018" role="listitem" l10n="U" oldref="63">Check <emph>Regular expressions</emph> 78*b1cdbd2cSJim Jagielski </paragraph> 79*b1cdbd2cSJim Jagielski </listitem> 80*b1cdbd2cSJim Jagielski <listitem> 81*b1cdbd2cSJim Jagielski <paragraph xml-lang="en-US" id="par_id3156382" role="listitem" l10n="U" oldref="64">Check <emph>Current selection only</emph> 82*b1cdbd2cSJim Jagielski </paragraph> 83*b1cdbd2cSJim Jagielski </listitem> 84*b1cdbd2cSJim Jagielski <listitem> 85*b1cdbd2cSJim Jagielski <paragraph xml-lang="en-US" id="par_id3146916" role="listitem" l10n="U" oldref="65">Click <emph>Replace All</emph> 86*b1cdbd2cSJim Jagielski </paragraph> 87*b1cdbd2cSJim Jagielski </listitem> 88*b1cdbd2cSJim Jagielski </list> 89*b1cdbd2cSJim Jagielski </section> 90*b1cdbd2cSJim Jagielski <section id="relatedtopics"> 91*b1cdbd2cSJim Jagielski <embed href="text/scalc/guide/text_numbers.xhp#text_numbers"/> 92*b1cdbd2cSJim Jagielski <embed href="text/scalc/guide/format_value.xhp#format_value"/> 93*b1cdbd2cSJim Jagielski </section> 94*b1cdbd2cSJim Jagielski </body> 95*b1cdbd2cSJim Jagielski</helpdocument>