dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Format Number in formula

  1. #1
    Join Date
    Jul 2019
    Posts
    8

    Format Number in formula

    Hey there,
    is it possible to format numbers inside the formula?
    Thanks for any replies.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Format Number in formula

    Yes. here is the example.
    Some more examples: https://www.google.com/search?newwin...30.BMYmSIZ-xK8
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2019
    Posts
    8

    Re: Format Number in formula

    Hmm jeah i read the same but I will lose the integer, i mean number type. Can I return it to number after the formatting? Kinda ToNumber (ToText ())? Without losing the formatting?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Format Number in formula

    Sorry, I couldn't get you...
    Number is just number. And format it somehow is just a way to show/display it as a text. After you have formatted a number it has not to change its value.
    Victor Nijegorodov

  5. #5
    Join Date
    Jul 2019
    Posts
    8

    Re: Format Number in formula

    I use the field in a function and its type is number. If I make totext(field) it wont be recognized as a number type and shows me an error. So can I convert it back After formatting like tonumber(totext(field)0,"")

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Format Number in formula

    Quote Originally Posted by Sam85 View Post
    I use the field in a function and its type is number. If I make totext(field) it wont be recognized as a number type and shows me an error. So can I convert it back After formatting like tonumber(totext(field)0,"")
    And what this function is supposed to do?
    Do you use it within your formula or somewhere else?
    Victor Nijegorodov

  7. #7
    Join Date
    Jul 2019
    Posts
    8

    Re: Format Number in formula

    Yes. I use will use the formula like that:

    intfield = Formula = tonumber (totext (field),0,""))
    In my function

    Function check (field as number) as Boolean
    'Some code with field = intfield
    End function

    Or shall i just change the type in the function to string?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Format Number in formula

    Victor Nijegorodov

  9. #9
    Join Date
    Jun 2019
    Location
    India
    Posts
    1

    Re: Format Number in formula

    Thank you, sir, for this link. It is helpful for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)