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 8543109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:13:31+00:00 2026-06-11T12:13:31+00:00

I am trying to create a global price markup that will insert into the

  • 0

I am trying to create a global price markup that will insert into the mysql table. I grab a variable from a simplexml element and multiply it by a number that is inserted by a form but the resulting answer is incorrect.

The variable calling from the xml file rounds up to a whole number and then multiples the $_post variable.

Sample..

$myprodprice = $myproduct->PRODUCTS_PRICE; // the xml value (sample is 2.33)
$mymarkup = $_post['mymarkup'];
echo $myprodprice;
echo $mymarkup;
$mymultiply = $myprodprice * $mymarkup;
echo $mymultiply;

Results will be

2.33

3.5

7

It ends up ignoring the xml variable decimal numbers when multiplying, but it will echo correctly otherwise.

Any help will be welcomed

  • 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-11T12:13:33+00:00Added an answer on June 11, 2026 at 12:13 pm

    Use floatval() to convert the strings to float values before multiplying.

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

Sidebar

Related Questions

I'm trying to create a global map that will map strings to factory functions.
I'm trying to create a global handler that gets called before the ajax success
I'm trying to create a page that, when refreshed, will randomly load a url
I'm trying to create a global Robot variable in a Java class without throwing
Here is what I am trying to do: Create a global gesture container that
I am trying to decide whether to create a global view table or 1
I'm trying to create a global (singleton) class that can associate any type of
im trying to create global variables of wx.Panel, wx.Button, and wx.TextCtrl, so that i
I'm trying to create a global context variable in one of my libraries, but
Trying to create a script that will send a 'sh run | b interface'

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.