0/1 Knapsack problem with real-valued weights
Sort the items by density such that $p_1/w_1\geq p_2/w_2\geq\cdots\geq p_n/w_n$ for profits $p$ and weights $w$. Let $W(k)=\sum_{1\leq i\leq k} w_i$ be the total weight of the first $k$ items in this order. Then for capacity $c$ an optimal fractional solution is to choose items $1,\ldots,i^*$ where $i^*$ is the largest number s.t. $W(i^*)\leq c$ , and additionally a fraction of $(c-W(i^*))/w_{i+1}$ of item $i^*+1$.

Update: I misread your question. For solving the $0$/$1$ version with real-valued weights you can either round them, or apply branch-and-bound algorithms that were designed for real values, e.g. Martello and Toth's MT1R.