Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]

One way to add JavsScript in functions.phhp is to put the JavaScript into a JS file an enqueue it. With wp_enqueue_script().

js/mynicecode.js

var x = myFunction(60000, 5.15464, 100); function myFunction(a, b, c) { return Math.round (a * b / c);

in functions.php

function my_load_scripts($hook) {
    wp_enqueue_script( 'mynicecode_js', plugins_url( 'js/mynicecode.js', __FILE__ ), array());
}
add_action('wp_enqueue_scripts', 'my_load_scripts');