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