-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Notebooks
- Notebook Software and How To Questions
- Real Integer Conversion. HP prime G2 -Langage HP PPL

Create an account on the HP Community to personalize your profile and ask a question
09-11-2024 04:48 AM
09-13-2024 03:11 PM
Hi wChris79_DS,
Welcome to the HP support community.
I understand that you are facing an issue with your computer, I am glad to assist you today.
To convert a REAL type to an INTEGER type in HP Prime's HP PPL (HP Prime Programming Language), you can use the ROUND or TRUNC functions to get an integer value from a real number. Here’s how you can do it:
Using ROUND: This function rounds a real number to the nearest integer. For example:
Using TRUNC: This function truncates the decimal part and keeps only the integer part of the real number. For example:
Using INT: This function can also be used to convert a real number to an integer by truncating the decimal part.
Make sure to choose the method that best fits your needs based on whether you want to round or simply truncate the decimal part. Once you have your integer value, you can proceed with instructions that require integer input.
I hope this helps! Let me know if you have any more questions.
ppl
Copy code
input := 3.7; // This is your real number integer_value := INT(input); // Converts it to integer
ppl
Copy code
input := 3.7; // This is your real number integer_value := TRUNC(input); // Converts it to integer
ppl
Copy code
input := 3.7; // This is your real number integer_value := ROUND(input); // Converts it to integer
Regards,
HP
Raj2111
I am an HP Employee
09-16-2024 02:19 PM
Hi @wChris79_DS ,
We did not hear from you after I replied to your post that you had created on HP Support Community.
This is a follow-up to know if the issue that you were facing with your HP product still persists, kindly help me with the details requested to assist you further.
Take care and have a great day ahead!
Regards,
Raj
Raj2111
I am an HP Employee