Skip to content
Magenaut

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

number-formatting

LOAD Data text fields vs numeric comma interactions

November 26, 2022 by Magenaut

I’m using the following to load a csv file to a mysql database:

Categories MySQL, Q&A Tags bulk-load, mysql, number-formatting Leave a comment

Apply comma to number field in MySQL

November 19, 2022 by Magenaut

I have a column that contains numbers. Is it possible to make the numbers appear with a comma on Server-Side with a function? or do I need to this on the client side with a php script? I would prefer server-side. Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all … Read more

Categories MySQL, Q&A Tags mysql, number-formatting, numbers, php Leave a comment

Add leading zero to numeric strings containing decimal value if no leading number

October 22, 2022 by Magenaut

I have about 200 lines in text file

Categories PHP, Q&A Tags leading-zero, number-formatting, php, preg-replace, regex Leave a comment

Show a number to two decimal places

October 21, 2022 by Magenaut

What’s the correct way to round a PHP string to two decimal places?

Categories PHP, Q&A Tags formatting, number-formatting, numbers, php, rounding Leave a comment

How to pad single-digit numbers with a leading 0

October 21, 2022 by Magenaut

I am looping an array of one-digit and two-digit numbers.

Categories PHP, Q&A Tags digits, number-formatting, php, zero-padding Leave a comment

PHP How do I round down to two decimal places?

October 19, 2022 by Magenaut

I need to round down a decimal in PHP to two decimal places so that: 49.955 becomes… 49.95 I have tried number_format, but this just rounds the value to 49.96. I cannot use substr because the number may be smaller (such as 7.950). I’ve been unable to find an answer to this so far. Any … Read more

Categories PHP, Q&A Tags decimal, number-formatting, php, rounding Leave a comment

PHP number format

October 17, 2022 by Magenaut

I have this string :

Categories PHP, Q&A Tags number-formatting, php Leave a comment

How to display Currency in Indian Numbering Format in PHP?

October 16, 2022 by Magenaut

I have a question about formatting the Rupee currency (Indian Rupee – INR).

Categories PHP, Q&A Tags converters, currency, money-format, number-formatting, php Leave a comment

How to prefix a positive number with plus sign in PHP

October 15, 2022 by Magenaut

I need to design a function to return negative numbers unchanged but should add a + sign at the start of the number if its already no present.

Categories PHP, Q&A Tags number-formatting, php, regex, string Leave a comment

number_format() causes error “A non well formed numeric value encountered”

October 14, 2022 by Magenaut

I am using number_format to round floats to only 2 decimal digits. The problem is that some of my inputs don’t have more than 2 decimals digits to begin with. So the code:

Categories PHP, Q&A Tags number-formatting, php Leave a comment
Older posts
Page1 Page2 Next →

Recent Comments

  • silverplugins217 on How to add placeholder for contact form7 for dropdown?
  • Shreyas Ikhar on How to add a custom CSS class to core blocks in Gutenberg editor?
  • Magenaut on How to call function on timer ASP.NET MVC
  • Ebaad Uddin on How to call function on timer ASP.NET MVC
  • michealSmith07 on Is there a way to dynamically refresh the less command?

Tags

.net adobe-illustrator adobe-photoshop ajax arrays asp.net asp.net-core asp.net-mvc bash c# css database django eloquent express html java javascript jquery json laravel laravel-4 laravel-5 laravel-8 linux list mongodb mongoose mysql node.js npm pandas php python python-3.x react-hooks react-native react-router reactjs redux regex sql string typescript wordpress
© 2023 Magenaut • Built with GeneratePress