How can I sell my text book to my students in e-book format?
Fairness is a difficult question to answer. You need to ask fair to who: the publisher, the author, or the students. Publishers provide a number of services (e.g., editing, typesetting, printing, and marketing). It is fair for them to get paid for their efforts. Obviously it is fair for authors to get paid for writing. It is also fair to expect students to pay for high quality learning materials.

The question then becomes what is a fair price to charge students and how much of that should go to the publisher. The fees charged by many publishers depend on the number of copies sold since they have some fixed costs that they need to recoup and some costs that scale with the number of copies sold. If you think the service being offered by the publisher is unfair, you can always self-publish and do the editing and marketing yourself.

As for the selling price, this really depends on the quality of the book relative to other similar books. That said, in my opinion selling your book to students in your class is unethical since the students are already paying for the teaching material indirectly through tuition and fees. I don't think of it as being different from selling lecture slides, notes, and exam keys and in the limit if you just want to make money from your students you could just sell grades.