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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:21:21+00:00 2026-05-27T09:21:21+00:00

I got everything almost where I want it. My only problem is that for

  • 0

I got everything almost where I want it. My only problem is that for some reason I can’t get the bctf1 to add right. Say if bctf = 10, the result with the code would be 100.59 instead of 10.59. Say if bctf = 25, the result with the code would be $251.03 instead of 26.03.

// BUY TOTAL
<script type="text/javascript">
function buytot(){
var bctf = document.getElementById('buyctf').value;
if(bctf.charAt(0) == "0" || bctf.charAt(0) == "" || bctf.charAt(0) == " "){
bctf2 = "0.00";
} else {
pcbctf = bctf*.029;
pcplusc = pcbctf+.30;
bctf1 = bctf+pcplusc;
bctf2 = Math.round(bctf1*100)/100;
}
document.getElementById('buyctotal').innerHTML = bctf2;
}
</script>

Here’s the HTML with JS -> http://jsfiddle.net/hhWDe/5/

  • 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-27T09:21:22+00:00Added an answer on May 27, 2026 at 9:21 am

    Thank You all 🙂 This is the working code. I add bctf0 = Number(document.getElementById('buyctf').value); after the else and everything worked fine.

    // BUY TOTAL
    function buytot(){
    var bctf = document.getElementById('buyctf').value;
    if(bctf.charAt(0) == "0" || bctf.charAt(0) == "" || bctf.charAt(0) == " "){ bctf2 = "0.00";
    } else {
    bctf0 = Number(document.getElementById('buyctf').value);
    pcbctf = bctf0*.029;
    pcplusc = pcbctf+.30;
    bctf1 = bctf0+pcplusc;
    bctf2 = Math.round(bctf1*100)/100;
    }
    document.getElementById('buyctotal').innerHTML = bctf2;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we've got an almost-finished-ready-to-go magento shop, that has developed an annoying problem. On the
I've got a view in my app that does pretty much everything, and I
I got a little problem, what I think, can't be hard. but somehow, I
I see there are some people that got Amazon’s payment module working w/ Magento
I created a custom browser from the WebKit framework. I almost got everything setup.
I've got a Java/Flex project that I'm building using Maven. After doing some research
I've got some code that does a bunch of set-up, then posts to Facebook
I am using the AutoresizingMask to define relative positions programatically. I got almost everything
I've got this site: http://p33.yamandi.com/ Almost everything works fine, except one little annoying thing
Tried almost everything and got no success making DefaultHttpClient() to work with expired SSL

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.