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