Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:28:26+00:00 2026-06-05T12:28:26+00:00

I am new to JRules coding.It may looks like a simple question. I would

  • 0

I am new to JRules coding.It may looks like a simple question. I would like to check the length of an number in JRules code. How to write the code for that. “the length of” phrase is expecting a string. I tried to use toString() to convert the number to String. But this is not working. Please give some idea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:28:29+00:00Added an answer on June 5, 2026 at 12:28 pm

    You can do that in multiple different ways, quite like going to Rome. 🙂

    1/ In your Java:

    public static int getIntLength(final int myLovelyNumber) {
        return (new Integer(myLovelyNumber)).toString().length();
    }
    

    Then, you add this lovely function to your BOM, and you verbalise it.
    Personally, I would create a separate library for such Helpers.
    An update will do the trick.

    2/ In your BOM:

    I will assume that you start from scratch
    a/ Create a ‘virtual’ object in your BOM (personally, I would create a separate BOM for ‘virtual’ objects) and set the “execution name” (or something like that) to java.lang.object
    b/ create a ‘virtual’ static method in the the ‘virtual’ object with one parameter: Integer returning a: int
    c/ in the B2X of your new ‘virtual’ method add:
    return param.toString().length();
    d/ verbalise the method

    Of course it is up to you to check for null value in Java or B2X.

    These are the main ways of doing it.
    One could find more tricky ways, but for a beginner (or not), it is a good approach.
    Hope it helps.

    PS: If you are happy with that then mark the answer as correct 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to jquery question... Using jQuery, depending on the radio button clicked I would
new with javascript here. I have a simple form that takes what the user
new to c#. I'm trying to make a simple system where I can search
new here and new to jQuery. I've searched for an answer to my question/
New programmer here, I am trying to understand and break down this code below
New question, but really close to need to refresh page in jquery mobile .
New to objective-c and I just can't find the answer to this question anywhere.
New to flash. When playing with a dummy 'tutorial' app, we saw that when
New to Objective-C and iOS development, would love a hand here! I have written
New to Web2py, so my question might not be too clear. I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.