[Question]
  [
We've had a few challenges for base conversion, but all of them seem to apply to integer values. Let's do it with real numbers!
# The challenge
Inputs:
* A real **positive number** *x*, expressed in base 10. This can be taken as a double-precision float or as a string. To avoid precision issues, the number can be assumed to be greater than 10−6 and less than 1015.
* A **target base** *b*. This will be an integer from 2 to 36.
* A **number of fractional digits** *n*. This will be an integer from 1 to 20.
Output: the **representation** of *x* in base *b* with *n* fractional digits.
When computing the output expression, the digits beyond the *n*-th should be **truncated** (not rounded). For example, `x = 3.141592653589793` in base `b = 3` is `10.0102110122...`, so for `n = 3` the output would be `10.010` (truncation), not `10.011` (rounding).
For *x* and *b* that produce a finite number of digits in the fractional part, the **equivalent infinite representation** (truncated to *n* digits) is also allowed. For example, `4.5` in decimal can also be represented as `4.49999...`.
Don't worry about **floating point errors**.
# Input and output format
*x* will be given without leading zeros. If *x* happens to be an integer you can assume that it will be given with a zero decimal part (`3.0`), or without decimal part (`3`).
The output is flexible. For example, it can be:
* A string representing the number with a suitable separator (decimal point) between integer and fractional parts. Digits `11`, `12` etc (for *b* beyond 10) can be represented as letters `A`, `B` as usual, or as any other distinct characters (please specify).
* A string for the integer part and another string for the fractional part.
* Two arrays/lists, one for each part, containing numbers from `0` to `35` as digits.
The only restrictions are that the integer and fractional parts **can be told apart** (suitable separator) and use the **same format** (for example, no `[5, 11]` for the list representing the integer part and `['5', 'B']` for the list representing the fractional part).
# Additional rules
* [Programs or functions](http://meta.codegolf.stackexchange.com/a/2422/36398) are allowed, in any [programming language](https://codegolf.meta.stackexchange.com/questions/2028/what-are-programming-languages/2073#2073). [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* Shortest code in bytes wins.
# Test cases
Output is shown as a string with digits `0`, ..., `9`, `A`, ... , `Z`, using `.` as decimal separator.
```
x, b, n                    ->  output(s)
4.5, 10, 5                 ->  4.50000 or 4.49999
42, 13, 1                  ->  33.0 or 32.C
3.141592653589793, 3, 8    ->  10.01021101
3.141592653589793, 5, 10   ->  3.0323221430
1.234, 16, 12              ->  1.3BE76C8B4395
10.5, 2, 8                 ->  1010.10000000 or 1010.01111111
10.5, 3, 8                 ->  101.11111111
6.5817645, 20, 10          ->  6.BCE2680000 or 6.BCE267JJJJ
0.367879441171442, 25, 10  ->  0.94N2MGH7G8
12944892982609, 29, 9      ->  PPCGROCKS.000000000
```
  
[Answer]
## JavaScript (ES8), ~~81~~ ~~74~~ 71 bytes
```
f=
(x,b,n,g=x=>x.toString(b))=>g(x-x%1)+'.'+g(x%1).substr(2,n).padEnd(n,0)
```
```
<div oninput=o.textContent=f(+x.value,b.value,n.value)><input id=x><input type=number min=2 max=36 value=10 id=b><input type=number min=1 max=20 value=10 id=n><pre id=o>
```
Works for `x` between `1e-6` and `1e21`, `b` from `2` to `36` (exactly as required) and `n` from `1` to anything from `10` to `48` depending on the base before floating-point errors creep in. Edit: Saved 7 bytes with help from @Birjolaxew. Saved a further 3 bytes with help from @tsh. Previous 74-byte version also worked with negative numbers:
```
f=
(x,b,n,[i,d]=`${x.toString(b)}.`.split`.`)=>i+`.`+d.slice(0,n).padEnd(n,0)
```
```
<div oninput=o.textContent=f(+x.value,b.value,n.value)><input id=x><input type=number min=2 max=36 value=10 id=b><input type=number min=1 max=20 value=10 id=n><pre id=o>
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~153~~ ~~149~~ ~~144~~ ~~137~~ ~~135~~ 109 bytes
```
def f(x,b,m):
 i=int(x);s=[];t=[]
 while i:s=[i%b]+s;i/=b
 while m:m-=1;x=x%1*b;t+=[int(x)]
 return s or[0],t
```
Hadn't noticed I can just return the digits as numbers, so that makes it a lot simpler. Returns two lists of digits, first for the integer part, second for the fractional.
[Try it online!](https://tio.run/##dU7LboMwELzzFb5U2IG62JiHjZwfiXKAJiiugomMq1JF@Xa6pkQ9VfKuNbM7s3P79pfR8mU5nXvU4znt0oGoCBltrMczaSZ9ODYeWoS@LuZ6RkYBZV66YzI15k13T35Qw6tmzaznF7brGp/A1moBSnf2n86iCY3ukB1Tv7T62g7dqUVWvV8ctomoE2z3mmVkV5HIbePdrGIa04/RWBxv/9DecJtOhPSjA0dj0UyikN6v6W1If3NwOr7Pas@Kx71Te@g2dIUQurtHTEE8tKDQoNGg0jZ12uFdv5kQEkUeC1qkiGUpKkhAHEAOFUBOmWCF5GWRF7WsJPDw6n9Gq02YMcpzAaCE4iuRhRt8k/6ip1FJi5pVpQgL2dMho3lZ1ZUUgrGKiRCK/9lz4GvJZc3LTMIESpLlBw "Python 2 – Try It Online")
[Answer]
# [Perl 6](https://perl6.org), 25 bytes
```
->\x,\b,\n{+x .base(b,n)}
```
[Try it](https://tio.run/##fVBda9tAEHy/X7GEppEaeXO79yFdQlOwCA4tbUP7GIViuwoYbMlYSXBJ88v61j/mrmyJljh04O643ZmduVuWq7nf3DclPHicnqnFD3g9GTflYFpXD@WqmdUVvN0Mzot1UkySono8XgO2hGiSVPHTZnl/B0eX5Xxeg0ir8aKEWQNHCTwfYpg8GXTOEjujXeZMAkYnkJ4pJVOiGNZrYLnc1iuYz6qyieLfv3BaLybRCRTfj@G6wPa8eQcnMS7Gy1N4c60R@QYeFQiWq1l1dwsHh6wbgEPebaeyN0V1kMDPV9/2ckVtFWL1tLHoEiAJ5OA5BucA0tYCkHAWbRAoyyKQVxC8qDAGt3TDmCuDZMkF9s64LKShfXwCWc8ljZo0E2l6ibpN1o9FbdgwkzVaEbKx0vSyeD8CoRlepD7PhtYEp8RFJnHnu8@WCEh6hzb5tqBph05t/q/uyR5dRqm3rZ/u0v9D9jjML9hnvVN3T98LlEbj0ywN1hKlZNtv5u4HWq3GYD/xx9FlOsoUsdCywCFjr4MQZYW/PldX@ejL5/zDV9Q9/gA "Perl 6 – Try It Online")
## Expanded:
```
-> \x, \b, \n {
  +x            # make sure it is a Numeric
  .base( b, n ) # do the base conversion
}
```
Note that the space is so that it is parsed as `(+x).base(b,n)`  
not `+( x.base(b,n) )`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 45 bytes
```
->x,b,n{(x*b**n).round.to_s(b).insert(~n,?.)}
```
### Why?
Since b^n in base b is 10^n, we multiply x by that number, and then add the decimal point where it belongs.
[Try it online!](https://tio.run/##dU/LCsIwELz7FT22JS7J5n1QP6QEaX2AB6NUCxUfv1431eJJ2IGdmc1kt@2a27BfDPNlzxoW73lfNmUZC2hPXdzC9bS@5E0Bh3jZtdf8FdkKiudQVQo0ywRnmQ5sVikkIgmJSBBKaI9GS@289aRTuT/WGJM8ASgVEUPAUeDpD/w@/bApyIB2whqVBviUwEEa66xXSggrVFoKf/FIuvPoHRruySH4EOBYn@@Pmm7fPM5ZNTYs23@aEJ7DGw "Ruby – Try It Online")
[Answer]
# Mathematica, 158 bytes
since this challenge allready got a very nice answer in mathematica by @KellyLowder, I tried to produce (with a different approach) **the exact results as shown in the test cases**
```
ToUpperCase[""<>Insert[StringReplace[ToString@BaseForm[#,p]&/@PadRight[#&@@(d=RealDigits[#,p=#2]),w=(#3+d[[2]])][[;;w]],"\n "<>ToString@p->""],".",d[[2]]+1]]&
```
  
**input**
> 
> [12944892982609, 29, 9]
> 
> 
> 
**output**
> 
> PPCGROCKS.000000000
> 
> 
> 
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~157~~ 152 bytes
Needs 64 bits `long int` for this to work with larger test cases.
*-5 bytes thanks to Peter Cordes*  
```
#define P r=99;i=l=x;do{z[--r]=48+7*(l%b>9)+l%b;}while(l/=b);printf(z+r)
long i,r,l;char z[99];f(x,b,n)double x;{P;putchar(46);while(n--){x=(x-i)*b;P;}}
```
[Try it online!](https://tio.run/##jY/LboMwEEX3fIWVqpIdBopfgGXRb8g@ySK8EkvURFbSoiC@nTpptyXd2PLonDvXVXSsqnl@qZvW2AZtkCuU0qboikHX/XjbRpHbFyIPszXuXst3RUJ/6enrZLoGd29FSfTZGXtp8S10JOh6e0SPw4CDTleng0O3rVJ73eIBSrCk7q9l16BBjxt9vl7uBBYp0T@RNorIOBR4iAxZl3qjp2n28ejjYCz@7E1N0Bgg1GIRS6AJSKL987fCauf1aGdXj6FnWAyUA11ieEwFlYqlEjjk/yO5zFWmONwbLBk0ZlwATYGyRSzxf2HLyx/Mk4JpLHOapUICYgmg5W5JzNMsz5QQlGZUCOYl@UyizPO5YipnaaJiryhA6m/DNZersyjRwRTM3w "C (gcc) – Try It Online")
edit: a few bytes can be shaved if it's allowed to output two strings separated by a newline separator:
## 149 bytes:
```
#define P r=99;i=l=x;do{z[--r]=48+7*(l%b>9)+l%b;}while(l/=b);printf(z+r)
long i,r,l;char z[99];f(x,b,n)double x;{P;puts("");while(n--){x=(x-i)*b;P;}}
```
edit: this submission is not the longest one, yay!
[Answer]
## Mathematica 47 Bytes
```
TakeDrop@@r[#,#2,#3+Last@(r=RealDigits)[#,#2]]&
```
Calling `RealDigits` twice to first figure out the number of digits to the left of the decimal. 
[Answer]
# [SageMath](http://www.sagemath.org/), 68 bytes
```
def f(n,b,k):y=n.str(b).split('.')+[''];return y[0],(y[1]+'0'*k)[:k]
```
[Try it online!](https://sagecell.sagemath.org/?z=eJwNw0EKgCAQAMB70B-87W6JmES0RS8RL1FCGBJqB39fA3OcXniMcpeBlrpFlUvCnVR-7qsgKKDeArg1neVNUVSrncRqB9eDhi6QXYJrm7Z50hULehwMj-PMhmczaZbC_JnoAydMG-g=&lang=sage)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 16 bytes
```
*×⁵b⁸ḞðṖḣ⁹,ṫø⁹N‘
```
[Try it online!](https://tio.run/##AToAxf9qZWxsef//KsOX4oG1YuKBuOG4nsOw4bmW4bij4oG5LOG5q8O44oG5TuKAmP///zE2/zEy/zEuMjM0 "Jelly – Try It Online")
Note that singletons are printed as the element in the output.
[Answer]
# [Haskell](https://www.haskell.org/), 188 bytes
```
f=fromIntegral
g 0 _=[]
g n p=g(div n p)p++[mod n p]
z=(!!)(['0'..'9']++['A'..'Z']++['.'])
h x p l|(i,d)<-properFraction x=z<$>(g i p++[36]++(last$g(floor$d*(f p**f l))p:[0<$[1..l]|d==0]))
```
[Try it online!](https://tio.run/##TVFta9swEP48/4qrCViKXaE3v4W4sIQuG1u3sn6bZ4apnRemxMJxN1P637NznYYdOvTonudOJ922PP6ujTmd1tm6bfafDl29aUvjbIDDrywvEBzAZhtS7f4MiFrfz/dNNeDCec7I1RUlucc9xrzUK5D03g/4x4iZV1BnCz1YMC9kF1R0fm3bxtbth7Z87HbNAfrseT65IRvYwVBbRZhITHnsJhuyNk3TTqopWYOdTtdgKLWznM8nuWDMFC9VlvGC0lPdl3tr6iNkkBPNwgAEDwA3Fw8czaUBEC0xrtAxrhQbg4oJLcJURqEKkzRO1WvekO6iREklpdBq1AomlUYyQsdarmBqcRtHy2ShVRqOEj7cjmQy8ByPgo/2H60uNBNne2UjFiYijvRQgZ@biNhieSuj5FKCMxXFSZxqLUQs9PAo@dYxZ6n@Ku9WH@NVMt4nUZekMk1kxFNUouNy7@@Xq@/flp8fGOeX/grH2Ze7A35i1Tjv9qW9A/KT9IENTFDT6xuwT91D1345wATcurf1Y1dXM3B9v/Z9NwAc6FNpZi74PpDjtvmLuvPsKYW3GZ3@AQ "Haskell – Try It Online")
`g` converts a number to a list representing that number in a given base
`z` maps integers to letters (`36 = .`)
`h` applies the previous functions to the integer and fractional part of a number.
[Answer]
# Axiom, 566 bytes
```
c:=alphanumeric()::List Character
f(a:INT,b:PI):List Character==(r:=[];repeat(y:=a rem b;r:=cons(c.(y+1),r);a:=a quo b;a=0=>break);r)
g(x)==floor(x)::INT
F(x)==>for i in 1..#x repeat z:=concat(z,x.i)
w(a:Float,b:PI,n:NNI):String==
  z:="";b<2 or b>36 or a<0=>z
  ip:=g(a);    fp:=g((a-ip)*b^n)
  ipb:=f(ip,b);fpb:=f(fp,b);cnt:=n-#fpb
  for i in 1..cnt repeat fpb:=cons(c.1,fpb)
  F(ipb);z:=concat(z,".");F(fpb)
  z
h(a,b,n)==>(n>=0 and b>0=>(nd123:=10+g(n*log_2(b)/log_2(10));mxv123456:=digits(nd123::PI);res78484:=w(a,b,n);digits(mxv123456);res78484);"")
```
it was particular difficult this question; afther some time in write something, the right results it seems
generate using one macro for preserve digits()... it is not golfed too much...results:
```
(7) -> h(4.5,10,5)
   (7)  "4.50000"
                                                             Type: String
(8) -> h(42,13,1)
   (8)  "33.0"
                                                             Type: String
(9) -> h(%pi,3,8)
   (9)  "10.01021101"
                                                             Type: String
(10) -> h(%pi,5,10)
   (10)  "3.0323221430"
                                                             Type: String
(11) -> h(1.234,16,12)
   (11)  "1.3BE76C8B4395"
                                                             Type: String
(12) -> h(0.367879441171442,25,10)
   (12)  "0.94N2MGH7G8"
                                                             Type: String
(13) -> h(12944892982609,29,9)
   (13)  "PPCGROCKS.000000000"
                                                             Type: String
(14) -> h(6.5817645,20,10)
   (14)  "6.BCE267JJJJ"
                                                             Type: String
```
the real target is one function that convert to base 2..36 each Float
[that has k:=digits()] or each calculated number as %pi or %e or the division of
two float/int as in 1./3. ['oo' digits]
```
(15) -> h(%pi,13,800)
   (15)
  "3.1AC1049052A2C77369C0BB89CC9883278298358B370160306133CA5ACBA57614B65B410020
  C22B4C71457A955A5155B04A6CB6CC2C494843A8BBBBA9A039B77B34CB0C036CAC761129B3168
  B8BAB860134C419787C911812985646C7AAA3025BAA118B3AB8265CB347852065667291482145
  6C533447BC53A5262177C9985455C395626091A2CC3126B395C91B65B654A1804226197528410
  29A8A4A55CC7937B347B77B5A914127B11C6A57A84510775A9A467819A468B6B74339CC1290B2
  24921C6A771BC2AB6AB41735119C2231545A86399483119AAA5AC34B46B7B5C9089946A364860
  9B26CB0BAC0ABCBA182C12881933AA93C3942C71AA664753989A3C82166BA2109796C4A134607
  59725A72C9117AC980556A147557C319438287226C94725B125753B009387A48AA45CB1960A04
  A064052C00A6069371949872B14590895C555CB01A39B7589824B8621618A8B1971841201A2AB
  B04B80C7534CC1CB079581491995B46C679555316288C82665645A1A600C1A669B865651B6B842470C018B03C1115B3C4306C015C0B45C"
                                                             Type: String
```
[Answer]
# Axiom, 127 bytes
```
g(a)==floor(a)::INT;f(a:Float,b:PI,n:NNI):Any==(b<2 or n>28=>%i;x:=g(a);radix(x,b)+radix(g((a-x)*b^n),b)::RadixExpansion b/b^n)
```
results
```
(4) -> f(%e,2,10)
   (4)  10.1011011111
                                                   Type: RadixExpansion 2
(5) -> f(%e,3,10)
   (5)  2.2011011212
                                                   Type: RadixExpansion 3
(6) -> f(%e,35,10)
   (6)  2.P4VBNEB51S
                                                  Type: RadixExpansion 35
(7) -> f(1.4,35,10)
   (7)  1.DYYYYYYYYY
                                                  Type: RadixExpansion 35
(8) -> f(%pi,3,8)
   (8)  10.01021101
                                                   Type: RadixExpansion 3
(9) -> f(%pi,5,10)
   (9)  3.032322143
                                                   Type: RadixExpansion 5
(10) -> f(1.234,16,12)
   (10)  1.3BE76C8B4395
                                                  Type: RadixExpansion 16
```
It has a little problem for final zero example
```
 f(4.5,10,5)
```
Would return '4.5' and not '4.50000'
]