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

  • Home
  • SEARCH
  • 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 3595746
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:53:34+00:00 2026-05-18T19:53:34+00:00

I am using this code to round down the decimal value to the next

  • 0

I am using this code to round down the decimal value to the next multiple of 25.
ie if value is 33.60 it should round to 33.50

create or replace
PROCEDURE         "TEST1" (PQUERY IN VARCHAR2) as
 prNspValue number(14,2) :='';
 p_percentage_Value number(4,2) :='';
  begin
  prNspValue:=33.60;
  dbms_output.put_line(prNspValue); 
  p_percentage_Value:=substr(prNspValue,instr(prNspValue,'.')+1,length(prNspValue));
  dbms_output.put_line(p_percentage_value); 
  p_percentage_Value:=p_percentage_Value-mod(p_percentage_Value,25);
  dbms_output.put_line(p_percentage_value);
  if(p_percentage_Value!=0)then
    prNspValue:=substr(prNspValue,1,instr(prNspValue,'.'))+p_percentage_Value/100;
  else 
  prNspValue:=substr(prNspValue,1,instr(prNspValue,'.'));
  end if;
 dbms_output.put_line(prNspValue);     
end;

but the problem is when the value is 33.60 it is taken as 33.6. so it is rounding it to 33.0.
How can i correct this code?

  • 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-05-18T19:53:35+00:00Added an answer on May 18, 2026 at 7:53 pm

    you can use the round function directly FLOOR(your_number*4)/4:

    SQL> WITH my_data AS (
      2     SELECT 33.00 num FROM dual
      3     UNION ALL SELECT 33.10 FROM dual
      4     UNION ALL SELECT 33.20 FROM dual
      5     UNION ALL SELECT 33.30 FROM dual
      6     UNION ALL SELECT 33.40 FROM dual
      7     UNION ALL SELECT 33.50 FROM dual
      8     UNION ALL SELECT 33.60 FROM dual
      9     UNION ALL SELECT 33.70 FROM dual
     10     UNION ALL SELECT 33.80 FROM dual
     11     UNION ALL SELECT 33.90 FROM dual
     12  ) SELECT num,
     13           floor (num * 4) / 4 rounded
     14      FROM my_data;
    
           NUM    ROUNDED
    ---------- ----------
            33         33
          33,1         33
          33,2         33
          33,3      33,25
          33,4      33,25
          33,5       33,5
          33,6       33,5
          33,7       33,5
          33,8      33,75
          33,9      33,75
    
    10 rows selected
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code, to make a request to a given URL: private static
I'm using this code, and I get the stack trace that is listed below.
I'm using this code from Microsoft to play audio notifications for my application. It's
I'm using this code to reset the identity on a table: DBCC CHECKIDENT('TableName', RESEED,
How can I change the master volume level? Using this code [DllImport (winmm.dll)] public
I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. }
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer
I get an error when I compile this code: using System; public struct Vector2
Consider this code... using System.Threading; //... Timer someWork = new Timer( delegate(object state) {

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.