Formatting number for leading zeros

  • I hope someone can help me. I have a preference field that allows
    users to enter a starting range number, now they need to be able to
    start numbers at say 000001 or -000001 for example. Now I can do this
    in the preference field because right now it is a string. If I add a
    number formatter to it, the next time it is displayed it displays as
    either 1 or -1. Is there anyway to set this up so it keeps the
    leading zeros?

    thanks,
  • On 7/11/07, development2 <development2...> wrote:
    > I hope someone can help me. I have a preference field that allows
    > users to enter a starting range number, now they need to be able to
    > start numbers at say 000001 or -000001 for example. Now I can do this
    > in the preference field because right now it is a string. If I add a
    > number formatter to it, the next time it is displayed it displays as
    > either 1 or -1. Is there anyway to set this up so it keeps the
    > leading zeros?

      You can set this in the Formatter's properties in IB.

      If you have the inspector palette open in IB when you drag the
    formatter into your text field, it automatically selects the
    ""Formatter" inspector page. Alternatively you can click the text
    field, then drop down the inspector panel's popup and select it
    yourself ...

    --
    I.S.
  • Thanks, yes I know that, and that what I have already done. But the
    problem with this is if I set it to use the Format positive: 00000
    and negative: -00000, and the user types in say 99, after they hit
    return it shows as 00099, I don't want that unless the user actually
    puts in the leading zeros. If they do not put in the leading zeros
    then I want it to show 99 like they typed in, but if they do type in
    the leading zeros, however many they type in, I want to keep that for
    them. I need to keep the format that they type in. So after looking
    at this I guess I will have to write my own formatter for this problem.

    Thanks.

    On Jul 11, 2007, at 12:26 PM, I. Savant wrote:

    > On 7/11/07, development2 <development2...> wrote:
    >> I hope someone can help me. I have a preference field that allows
    >> users to enter a starting range number, now they need to be able to
    >> start numbers at say 000001 or -000001 for example. Now I can do this
    >> in the preference field because right now it is a string. If I add a
    >> number formatter to it, the next time it is displayed it displays as
    >> either 1 or -1. Is there anyway to set this up so it keeps the
    >> leading zeros?
    >
    > You can set this in the Formatter's properties in IB.
    >
    > If you have the inspector palette open in IB when you drag the
    > formatter into your text field, it automatically selects the
    > ""Formatter" inspector page. Alternatively you can click the text
    > field, then drop down the inspector panel's popup and select it
    > yourself ...
    >
    > --
    > I.S.
    >
  • What was wrong with just leaving it without a formatter?

    On Jul 11, 2007, at 1:28 PM, development2 wrote:

    > Thanks, yes I know that, and that what I have already done. But the
    > problem with this is if I set it to use the Format positive: 00000
    > and negative: -00000, and the user types in say 99, after they hit
    > return it shows as 00099, I don't want that unless the user
    > actually puts in the leading zeros. If they do not put in the
    > leading zeros then I want it to show 99 like they typed in, but if
    > they do type in the leading zeros, however many they type in, I
    > want to keep that for them. I need to keep the format that they
    > type in. So after looking at this I guess I will have to write my
    > own formatter for this problem.
    >
    > Thanks.
    >
    > On Jul 11, 2007, at 12:26 PM, I. Savant wrote:
    >
    >> On 7/11/07, development2 <development2...> wrote:
    >>> I hope someone can help me. I have a preference field that allows
    >>> users to enter a starting range number, now they need to be able to
    >>> start numbers at say 000001 or -000001 for example. Now I can do
    >>> this
    >>> in the preference field because right now it is a string. If I add a
    >>> number formatter to it, the next time it is displayed it displays as
    >>> either 1 or -1. Is there anyway to set this up so it keeps the
    >>> leading zeros?
    >>
    >> You can set this in the Formatter's properties in IB.
    >>
    >> If you have the inspector palette open in IB when you drag the
    >> formatter into your text field, it automatically selects the
    >> ""Formatter" inspector page. Alternatively you can click the text
    >> field, then drop down the inspector panel's popup and select it
    >> yourself ...
    >>
    >> --
    >> I.S.
    >>

  • Am 11.07.2007 um 22:28 schrieb development2:

    > Thanks, yes I know that, and that what I have already done. But the
    > problem with this is if I set it to use the Format positive: 00000
    > and negative: -00000, and the user types in say 99, after they hit
    > return it shows as 00099, I don't want that unless the user actually
    > puts in the leading zeros. If they do not put in the leading zeros
    > then I want it to show 99 like they typed in, but if they do type in
    > the leading zeros, however many they type in, I want to keep that
    > for them. I need to keep the format that they type in. So after
    > looking at this I guess I will have to write my own formatter for
    > this problem.

    You do not want an Formatter - i.e. something that provides always
    uniform display - but probably some validation mechanismn for your
    input.
previous month july 2007 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today