Tell us what’s happening:
The major problem is getting my PI to have a 1000 decimal places or digits its not an integer so BigInt() does not apply, someone please guide me!
function getPiDecimal(n) {
let pi = Math.PI.toString();
return Number(pi[n + 1]);
}
console.log(getPiDecimal(999))
Your code so far
function getPiDecimal(n) {
let pi = Math.PI.toString();
return Number(pi[n + 1]);
}
console.log(getPiDecimal(3))
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Challenge Information:
Daily Coding Challenge - Pi Day
https://www.freecodecamp.org/learn/daily-coding-challenge/2026-03-14