Convert int int for those tens int, int for onehundereds

I should know this basic programming, but I have a white full spirit.

What is the best way to take an integer like 125 and divide by an integer to put the hundreds, dozens of place and those.  For example, 125 would be:

hundreds of int = 1

dozens of int = 2

int people = 5

Thank you!

Several ways to do so. One simple way is to convert a string and then break up in this way. Other ways involve also doing the simple math with modulo division and taking whole pieces (eg., if you want to the kth of N-integer_part ((N % 10^k)/10 ^(k-1) figure) did the trick)

There is nothing specific BlackBerry which handles this.

Tags: BlackBerry Developers

Similar Questions

  • How to convert int to String

    How to convert int to String. I get the error 'cannot convert integer to int.

    Dim str As String = "abc";

    int NB = Integer.valueOf (str);

    Use Integar.parseInt (). But make sure your str contains the integer value (like str = '123') otherwise you will get the exception.

    String str = "123"; int num = Integer.parseInt(str);
    

    Concerning

    Bika

  • Convert the Sql for Oracle script

    Could someone help me convert the sql script in oracle below

    -- EXEC SP_smpAGENCY_MYWS_LAPSE_GET_USP_AMSurrenderMngtReport '2005','2010','09048','IL'    
    ALTER PROCEDURE SP_smpAGENCY_MYWS_LAPSE_GET_USP_AMSurrenderMngtReport    
    --DECLARE     
    @StartYY AS VARCHAR(4),    
    @EndYY AS VARCHAR(4),    
    @AgentCode AS VARCHAR(9),    
    @CompanyCode AS VARCHAR(4)    
        
    AS    
        
    DECLARE @ProfileYYYYMM AS VARCHAR(6), @SQLStr1 AS VARCHAR(8000),@SQLStr2 AS VARCHAR(8000), @SQLStr3 AS VARCHAR(8000)    
        
    SET @ProfileYYYYMM = '201005'    
        
    SET @SQLStr1 = ''    
        
    SET @SQLStr1 = @SQLStr1 + ' DECLARE @CompAvgCount AS  DECIMAL(38,2), @CompAvgAP AS  DECIMAL(38,2), @CompInforceAP AS DECIMAL(15,2), @CompSurrenderAP AS DECIMAL(15,2), '    
    SET @SQLStr1 = @SQLStr1 + ' @CompInforceCount NUMERIC, @CompSurrenderCount NUMERIC,@ALCompInforceAP AS DECIMAL(15,2), @ALCompSurrenderAP AS DECIMAL(15,2), '    
    SET @SQLStr1 = @SQLStr1 + ' @ALCompInforceCount NUMERIC, @ALCompSurrenderCount NUMERIC,@ILCompInforceAP AS DECIMAL(15,2), @ILCompSurrenderAP AS DECIMAL(15,2), '    
    SET @SQLStr1 = @SQLStr1 + ' @ILCompInforceCount NUMERIC, @ILCompSurrenderCount NUMERIC '    
      
    SET @SQLStr1 = @SQLStr1 + ' DECLARE @tblAgentNumber TABLE '    
    SET @SQLStr1 = @SQLStr1 + ' ( '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentName] VARCHAR(255), '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentNumber] VARCHAR(9), '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentRank] VARCHAR(10) '    
    SET @SQLStr1 = @SQLStr1 + ' ) '    
      
    SET @SQLStr1 = @SQLStr1 + '  DECLARE @tblmineInForce TABLE '    
    SET @SQLStr1 = @SQLStr1 + ' ( '    
    SET @SQLStr1 = @SQLStr1 + '  [company_code] VARCHAR(50), '    
    SET @SQLStr1 = @SQLStr1 + '  [mine_policy_no] VARCHAR(50), '    
    SET @SQLStr1 = @SQLStr1 + '  [Annl_premium] NUMERIC(28, 2) '    
    SET @SQLStr1 = @SQLStr1 + ' ) '    
        
    SET @SQLStr1 = @SQLStr1 + ' DECLARE @tblmineSurrender TABLE '   
    SET @SQLStr1 = @SQLStr1 + ' ( '    
    SET @SQLStr1 = @SQLStr1 + '  [company_code] VARCHAR(50), '    
    SET @SQLStr1 = @SQLStr1 + '  [mine_policy_no] VARCHAR(50), '     
    SET @SQLStr1 = @SQLStr1 + '  [Annl_premium] NUMERIC(28, 2) '    
    SET @SQLStr1 = @SQLStr1 + ' ) '    
        
    SET @SQLStr1 = @SQLStr1 + ' INSERT INTO @tblAgentNumber '    
    SET @SQLStr1 = @SQLStr1 + ' SELECT AgentName, AgentNumber, AgentRank '    
    SET @SQLStr1 = @SQLStr1 + ' FROM [SUMYOLAP0001].aetnaildb.dbo.agentprofile'+ @ProfileYYYYMM +' AgtProfile '    
    SET @SQLStr1 = @SQLStr1 + ' WHERE (LEN(agentnumber) = 5 and (left(agentnumber,1) between ''0'' and ''8'' or left(agentnumber,1) = ''A'')) '    
    SET @SQLStr1 = @SQLStr1 + ' AND (Amname not like ''%COMPANY%'' OR Amname not like ''%DIRECT%'' OR Amname not like ''%MARKETsmp%'') '    
    SET @SQLStr1 = @SQLStr1 + ' AND agencynumber not in (''ILS'',''PLS'',''99999'') '    
    SET @SQLStr1 = @SQLStr1 + ' AND LEFT(agencynumber,2) not in (''CD'',''DR'') AND LEFT(agencynumber,3) <> ''DIR'' '    
    SET @SQLStr1 = @SQLStr1 + ' AND RIGHT(RTRIM(agencynumber),2) not in (''CD'',''DR'') AND RIGHT(RTRIM(agencynumber),3) <> ''DIR'' '    
    SET @SQLStr1 = @SQLStr1 + ' AND companycode = ''IL'' '    
        
    SET @SQLStr1 = @SQLStr1 + ' INSERT INTO @tblmineSurrender '    
    SET @SQLStr1 = @SQLStr1 + ' SELECT company_code, mine_policy_no, Annl_premium '    
    SET @SQLStr1 = @SQLStr1 + ' FROM odsmine_policy '    
    IF @CompanyCode = 'All'    
    BEGIN    
     SET @SQLStr1 = @SQLStr1 + ' WHERE company_code IN (''IL'',''AL'') '    
    END    
    ELSE    
    BEGIN    
     SET @SQLStr1 = @SQLStr1 + ' WHERE company_code IN ('''+ @CompanyCode +''') '    
    END    
    SET @SQLStr1 = @SQLStr1 + ' AND cont_status = ''S'' '    
    SET @SQLStr1 = @SQLStr1 + ' AND YEAR(effective_date) BETWEEN '+ @StartYY +' AND '+ @EndYY +' '    
        
    SET @SQLStr1 = @SQLStr1 + ' SELECT @CompSurrenderCount = COUNT(1), @CompSurrenderAP = SUM(Annl_premium) '    
    SET @SQLStr1 = @SQLStr1 + ' FROM @tblmineSurrender S '    
    SET @SQLStr1 = @SQLStr1 + ' INNER JOIN odsagent_role R '    
    SET @SQLStr1 = @SQLStr1 + ' ON S.company_code = R.company_code '    
    SET @SQLStr1 = @SQLStr1 + ' AND S.mine_policy_no = R.mine_policy_no '    
    SET @SQLStr1 = @SQLStr1 + ' INNER JOIN @tblAgentNumber A '    
    SET @SQLStr1 = @SQLStr1 + ' ON R.servicsmpagent_code = A.AgentNumber '    
        
    SET @SQLStr1 = @SQLStr1 + ' INSERT INTO @tblmineInforce '    
    SET @SQLStr1 = @SQLStr1 + ' SELECT company_code, mine_policy_no, Annl_premium '    
    SET @SQLStr1 = @SQLStr1 + ' FROM odsmine_policy '    
    IF @CompanyCode = 'All'    
    BEGIN    
     SET @SQLStr1 = @SQLStr1 + ' WHERE company_code IN (''IL'',''AL'') '    
    END    
    ELSE    
    BEGIN    
     SET @SQLStr1 = @SQLStr1 + ' WHERE company_code IN (''' + @CompanyCode + ''') '    
    END    
    SET @SQLStr1 = @SQLStr1 + ' AND cont_status = ''I'' '    
    SET @SQLStr1 = @SQLStr1 + ' AND YEAR(effective_date) BETWEEN '+ @StartYY +' AND '+ @EndYY +' '    
        
    SET @SQLStr1 = @SQLStr1 + ' SELECT @CompInforceCount = COUNT(1), @CompInforceAP = SUM(Annl_premium) '    
    SET @SQLStr1 = @SQLStr1 + ' FROM @tblmineInforce I '    
    SET @SQLStr1 = @SQLStr1 + ' INNER JOIN odsagent_role R '    
    SET @SQLStr1 = @SQLStr1 + ' ON I.company_code = R.company_code '    
    SET @SQLStr1 = @SQLStr1 + ' AND I.mine_policy_no = R.mine_policy_no '    
    SET @SQLStr1 = @SQLStr1 + ' INNER JOIN @tblAgentNumber A '    
    SET @SQLStr1 = @SQLStr1 + ' ON R.servicsmpagent_code = A.AgentNumber '    
        
    SET @SQLStr1 = @SQLStr1 + ' SET @CompAvgCount = ROUND(ISNULL(@CompSurrenderCount,0) * 100 / ( ISNULL(@CompSurrenderCount,0) + @CompInforceCount),2) '     
    SET @SQLStr1 = @SQLStr1 + ' SET @CompAvgAP = ROUND(ISNULL(@CompSurrenderAP,0) * 100 / ( ISNULL(@CompSurrenderAP,0) + @CompInforceAP),2) '     
        
    SET @SQLStr1 = @SQLStr1 + ' DECLARE @tblODSmine_Policy TABLE '    
    SET @SQLStr1 = @SQLStr1 + ' ( '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentName] VARCHAR(255), '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentNumber] VARCHAR(9), '    
    SET @SQLStr1 = @SQLStr1 + '  [AgentRank] VARCHAR(10), '    
    SET @SQLStr1 = @SQLStr1 + '  [Company_Code] VARCHAR(4), '    
    SET @SQLStr1 = @SQLStr1 + '  [mine_Policy_No] VARCHAR(10), '    
    SET @SQLStr1 = @SQLStr1 + '  [Cont_Status] VARCHAR(1), '    
    SET @SQLStr1 = @SQLStr1 + '  [Annl_Premium] DECIMAL(15,2), '    
    SET @SQLStr1 = @SQLStr1 + '  [No_count] NUMERIC '    
    SET @SQLStr1 = @SQLStr1 + ' ) '    
        
    SET @SQLStr2 = 'INSERT INTO  @tblODSmine_Policy '    
    SET @SQLStr2 = @SQLStr2 + ' SELECT DISTINCT AgtProfile.AgentName, AgtProfile.AgentNumber, '    
    SET @SQLStr2 = @SQLStr2 + ' AgtProfile.AgentRank,mine.company_code, mine.mine_policy_no, mine.cont_status, mine.Annl_Premium, 1.0 as no_count '    
    SET @SQLStr2 = @SQLStr2 + ' FROM @tblAgentNumber AgtProfile '    
    SET @SQLStr2 = @SQLStr2 + ' INNER JOIN [SUMYOLAP0001].aetnaildb.dbo.COMAGH COMAGH '    
    SET @SQLStr2 = @SQLStr2 + ' ON AgtProfile.AgentNumber = COMAGH.AHAGTN '    
    SET @SQLStr2 = @SQLStr2 + ' AND (AHAMNO = ''' + @AgentCode + ''' OR AHUMNO = ''' + @AgentCode + ''' OR AHAGNO = ''' + @AgentCode + ''') '    
        
    IF @CompanyCode = 'ALL'    
    BEGIN    
     SET @SQLStr2 = @SQLStr2 + ' AND AHCO IN (''AL'',''IL'') '    
    END    
    ELSE    
    BEGIN    
     SET @SQLStr2 = @SQLStr2 + ' AND AHCO = ''' + @CompanyCode + ''' '    
    END    
        
    SET @SQLStr2 = @SQLStr2 + ' INNER JOIN odsagent_role Role '    
    SET @SQLStr2 = @SQLStr2 + ' ON AgtProfile.AgentNumber = Role.servicsmpagent_code '    
    SET @SQLStr2 = @SQLStr2 + ' INNER JOIN odsmine_policy mine '    
    SET @SQLStr2 = @SQLStr2 + ' ON Role.company_code = mine.company_code '    
    SET @SQLStr2 = @SQLStr2 + ' AND Role.mine_policy_no = mine.mine_policy_no '    
    SET @SQLStr2 = @SQLStr2 + ' AND mine.cont_status IN (''S'',''I'') '    
        
    IF @CompanyCode = 'ALL'    
    BEGIN    
     SET @SQLStr2 = @SQLStr2 + ' AND mine.company_code IN (''AL'',''IL'') '    
    END    
    ELSE     
    BEGIN    
     SET @SQLStr2 = @SQLStr2 + ' AND mine.company_code = ''' + @CompanyCode + ''' '    
    END    
        
    SET @SQLStr2 = @SQLStr2 + ' AND YEAR(mine.effective_date) BETWEEN '+ @StartYY +'  AND  '+ @EndYY +' '    
        
    SET @SQLStr3 = 'SELECT AgentName, AgentRank, AgentNumber, '    
    SET @SQLStr3 = @SQLStr3 + ' CONVERT(INT,SUM(CASE WHEN cont_status = ''S'' THEN no_count ELSE 0 END)) AS Surrrender_Count, '    
    SET @SQLStr3 = @SQLStr3 + ' CONVERT(INT,SUM(CASE WHEN cont_status = ''I'' THEN no_count ELSE 0 END)) AS InForce_Count, '    
    SET @SQLStr3 = @SQLStr3 + ' SUM(CASE WHEN cont_status = ''S'' THEN Annl_premium ELSE 0 END) AS SurrenderAP, '    
    SET @SQLStr3 = @SQLStr3 + ' SUM(CASE WHEN cont_status = ''I'' THEN Annl_premium ELSE 0 END) AS InForceAP, '    
    SET @SQLStr3 = @SQLStr3 + ' CASE WHEN count(*) = 0 THEN 0 ELSE CONVERT(DECIMAL(38,2),(SUM(CASE WHEN cont_status = ''S'' THEN no_count ELSE 0 END) * 100 / count(*))) END AS AgtSurrenderCount, '    
    SET @SQLStr3 = @SQLStr3 + ' CASE WHEN SUM(Annl_premium) = 0 THEN 0 ELSE CONVERT(DECIMAL(38,2),(SUM(CASE WHEN cont_status = ''S'' THEN Annl_premium ELSE 0 END) * 100 / SUM(Annl_premium))) END AS AgtSurrenderAP, '    
    SET @SQLStr3 = @SQLStr3 + ' CONVERT(varchar(100),@CompAvgCount) AS CompAvgCount, '    
    SET @SQLStr3 = @SQLStr3 + ' CONVERT(varchar(100), @CompAvgAP) AS CompAvgAP '    
    SET @SQLStr3 = @SQLStr3 + ' FROM @tblODSmine_Policy '    
    SET @SQLStr3 = @SQLStr3 + ' GROUP BY AgentName, AgentRank, AgentNumber '    
        
    EXEC (@SQLStr1 + @SQLStr2 + @SQLStr3)    
    --PRINT (@SQLStr1 + @SQLStr2 + @SQLStr3)    

    Yes.

    1. the scrap code.
    2. get the specification of the requirements of business origin.
    3. learn PL/SQL.
    4. write the PL/SQL code to meet the requirements of the company.

  • Converter USB/serial for Satellite P100-112

    Hi, I need to buy a converter usb/serial for my P100-112. The one I have, I can't make it work with my current machine. Tips for what to buy would be appreciated.

    Hey Buddy,

    I googled a bit around and found an example for a converter that can be useful for you:

    http://www.ramelectronics.NET/HTML/usb_serial.htm

    Please give some feedback what you need exactly, maybe find us something better...

    Welcome them

  • I want to convert windows 7 for xp professional can someone help me?

    I want to convert windows 7 for xp professional can someone help me?

    Hello

    Thank you for contacting Microsoft Community.

    Unfortunately, you can not convert Windows 7 to Windows XP. You will need to perform a new installation of Windows XP (for example formatting partition of Windows 7 and then installing Windows XP).

    Try the Windows XP Mode, which requires Windows 7 Professional or ultimate or business (32-bit or 64-bit, both are supported) where a copy of Windows XP must be installed through Windows Virtual PC. You can install and access the applications in Windows XP Mode.

    Note that the support (currently extended support, support mainline has been terminated already) for Windows XP will end soon.

  • The fonts in Illustrator are swoop for use with a laser engraving? If not, how do I convert a font for a single path... not an overview of the police?

    The fonts in Illustrator are swoop for use with a laser engraving? If not, how do I convert a font for a single path... not an overview of the police?

    "I try to avoid cutting each line twice.  This is double the cost.

    I hear you. I was there for more than 30 years.

    There are very few single line fonts. And most of the people is the property of specific burning software (i.e. the TTF or OTF fonts). Apart from these burning programs, what had to happen is for a foundry of fonts specifically design a single font. And, from what I've heard of these smelters (for the last 30 + years), the market is too small. I'm not saying that they are correct, it's just that it is their perception.

    Good luck

    -OB

  • How can I convert Photoshop Elements for my new PC?

    How to convert Photoshop Elements for my new PC?

    Hello

    Please download https://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-downloads.html

    For another platform, please see a product for another language or version of trading platform

    Kind regards

    Sheena

  • I converted a file for a friend from pdf to doctx; he receives this messgae when he tried to open the testament of file is not open, "invalid directory name.

    I converted a file for a friend from pdf to doctx; He received this message while trying to open the will of file is not open, "invalid directory name.

    Hi vasiliost69641524,

    This error is supposed to be linked with MS Word, please refer to this link directory name of the error invalid - Microsoft community.

    Kind regards

    Nicos

  • Since the upgrade to CS6, I see is no longer how to convert files from, for example, a PDF to JPEG and vice versa.  It used to be so simple.  Can anyone help with this?

    Since the upgrade to CS6, I say is no longer how do to convert files from, for example, a PDF file as a JPEG or another type (gif, png, etc.).  When I look at the file in the Finder it simply brings me directly to my original in inDesign document, rather than to appear on the left side of the screen with the save option under sub folder as it did before.  Does anyone know how I can convert the files, I need to do a lot!

    ???? Conversion of files with InDesign? Never have been possible. The only thing you could and can do is to export an InDesign document. You can export to PDF, jpg, etc. just like before.

  • You can save a. CPTX (project) as one. CPTL (model) and convert later than for one. File CPTX? I just need a little clarification on this operation in Adobe Captivate 8.

    You can save a. CPTX (project) as one. CPTL (model) and convert later than for one. File CPTX? I just need a little clarification on this operation in Adobe Captivate 8. Thanks in advance!

    Sorry, but I neglected to include a bit small (but essential) information on this thing cptl.

    A file cptl is a model of Captivate. When you create one and create a new project based on a template, you point to the .cptl file. And at this time, no matter what the .cptl file has inside of it at this time is copied to a new project file. From there, you simply save the project and .cptx is assumed. The CPTL will already have the draft resolution together and many other things. The beauty is that once it is all set up correctly, it allows you to create faster training because you don't have to stop and consider things like the resolution of project, which should show the first slide, which should show the last slide, but also a host of other possibilities.

    The reactive substance, you need to ask one of the new kids on the block who is struck with it. I'm old school and have yet to fully embrace it. It's new and full of contradictions. And I really struggled with how many people ask to see training which normally runs on a large monitor displayed on their tiny phone screens where text messages are often barely legible.

    See you soon... Rick

  • Can I convert an existing for muse file html file?

    Can I convert an existing for muse file html file?

    Hello

    From now on, Muse does not offer this option to convert a HTML file in a file of Muse.

    However, I ask you to do this post as a feature on ideas for features in Adobe Muse request

    Kind regards

    Rohit Nair

  • Convert Int to byte array.

    Hello

    I am trying to convert an int to an array of bytes and stumbled upon a solution. However, it is not appropriate for BB/J2ME.

    byte[] bytes = ByteBuffer.allocate(4).putInt(1695609641).array();
    
    for (byte b : bytes) {
       System.out.format("0x%x ", b);
    }
    

    I have converted into loop, but not an alternative to System.out.format () there is no J2ME.

    How can I convert my whole in byte array?

    Thank you.

    Hi guys, sorry for the delay in responding. Basically, I have to send my ACR122U an int on NFC. If int is more than 255 does not in a single byte then I have to represent in an array of bytes, right?

    I think RexDoug is correct also, I don't understand masking and stuff like that. It's something that I've always been conscious of good :/

    Thank you guys.

    Here's what I went with:

      public byte[] intToBytes(int value) {
    
             return new byte[] {
                        (byte) ((value >>> 24) & 0xff),
                        (byte) ((value >>> 16) & 0xff),
                        (byte) ((value >>> 8) & 0xff),
                        (byte) (value & 0xff),
                      };
        }
    

    REF: http://stackoverflow.com/questions/9587605/java-integer-to-byte-array-blackberry-j2me/9587708#958770...

  • Convert int value of sql in QString without using C++

    Hi, I'm having trouble passing an integer value in my list. I am entirely dependent on QML and would rather not touch C++ because they tend to create more problems for me sometimes.

    I need to load some data such as: Int ID, string directory in my GroupDataModel.

    It is:

    (1) I use the ID as a sort key

    AND

    (2) I want to display on my list as well.

    I found another solution that calls for the values to store them as "001, 002, 003," etc, but as I mentioned, I would like to view the information and is not sustainable.

    I wonder if maybe I can use javascript to convert this string? I tried to look for Qt btu solutions, they are all highly dependent on C++ and I do not want to touch that.

    I tried:

     function convertInt (data){return QString(%1).arg(ListItemData.CategoryID || "")}
    

    But it doesn't seem to work at all...

    I also tried ListItemData.CategoryID.toString () but it does not work as well...

    Can someone please? Thank you!

    After hours of trial and error, I finally managed to get CategoryID show.

    Instead of referring to him as ListItemData.CategoryID, I just used: ListItemData under the heading ListItemComponent.

    I also deleted the itemType function because it does not seem necessary here atm.

    Apparently it's kind of 'automatic' putting in the CategoryID in the sortingKeys and grouping.

  • serializeJSON is converting ints to floats

    CF10 updated 11 Win7 x 64

    I'm running on a problem that I just noticed with serializeJSON()... ints are converted to floats. Here is the code:

    < cfset r = {}

    « x » : 0,

    'y': 1

    } >

    < cfoutput > < pre > #serializeJSON (r) # < / pre > < / cfoutput >

    < cfset r.x = int (Val ("1")) >

    < cfset r.y = ceiling(100/10) >

    < cfoutput > < pre > #serializeJSON (r) # < / pre > < / cfoutput >

    Here is the result:

    {« y » : 1, « x » : 0}

    {: 10.0 'y', 'x':1.0}}

    Is this messed up or what?

    Also discovered that a simple addition operation creates a float:

    Release 3.0

    Workaround solution:

  • Convert Int to String... Incompatible Types error

    Dear members,

    I have an AM procedure that accepts two variable. Procedure is as follows:

    ' Public Sub myProcedure (param1, String userId, String)
    *{*
    * / * My logic * / *.
    *.....*
    *.....*
    *}*

    I call this procedure from the co Code. in my CO is the following:

    *.....*
    *.....*
    String param1 = "Value1";
    int userId = pageContext.getUserId ();
    * Serializable para [] = {param1, username}; *
    am.invokeMethod ("myProcedure", para);
    *......*
    *....*

    When I execute this code, I get the below error:

    INCOMPATIBLE TYPES; FOUND: INT, NEED JAVA. IO. SERIALIZABLE

    It sounds like I should pass only string variables to the serializable method. How can I convert the variable of integer type to the string variable.

    Kindly please help me to solve this problem.

    Thanks in advance.

    Best regards
    Arun D. Reddy

    Hi Arun

    Replace your line of code int userId = pageContext.getUserId ();
    with

    String UserId = "" + pageContext.getUserId ();
    Concerning
    Ravi

Maybe you are looking for